#include <gmlib/number/mont256.h>
#include <gmlib/number/uint256.h>

#include <stdexcept>
#include <cstring>

using namespace number;

static std::uint8_t  P_data[32]      = {0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
static std::uint8_t  P_SUB2_data[32] = {0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd};
static std::uint8_t  R_data[32]      = {0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};
static std::uint8_t  R_POW2_data[32] = {0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03};
static std::uint8_t  N_data[32]      = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};

void test_mont256_pow()
{
    uint256_t P, P_SUB2, R, R_POW2, N_;
    uint256_from_bytes(P, P_data);
    uint256_from_bytes(P_SUB2, P_SUB2_data);
    uint256_from_bytes(R, R_data);
    uint256_from_bytes(R_POW2, R_POW2_data);
    uint256_from_bytes(N_, N_data);

    Mont256CTX ctx;
    ctx.P = P, ctx.P_SUB2 = P_SUB2;
    ctx.R = R, ctx.R_POW2 = R_POW2;
    ctx.N_ = N_;

    mont256_t    base, exponent, power;
    std::uint8_t power_data[32];

    std::uint8_t base0[32]     = {0xd2,0x3f,0x08,0x24,0x12,0x8b,0x2f,0x33,0x0c,0x5c,0x7f,0xd0,0xa6,0xa3,0xa4,0x50,0x65,0x13,0x27,0x0e,0x26,0x9e,0x0d,0x37,0xf2,0xa7,0x4d,0xe4,0x52,0xe6,0xb4,0x38};
    std::uint8_t exponent0[32] = {0x36,0xf6,0x75,0xcc,0x81,0xe7,0x4e,0xf5,0xe8,0xe2,0x5d,0x94,0x0e,0xd9,0x04,0x75,0x95,0x31,0x98,0x5d,0x5d,0x9d,0xc9,0xf8,0x18,0x18,0xe8,0x11,0x89,0x2f,0x90,0x2b};
    std::uint8_t power0[32]    = {0x6e,0x24,0x60,0xa9,0x53,0x38,0x25,0x52,0x40,0xd4,0x69,0x43,0xa5,0xc9,0x28,0x1e,0xa8,0xa9,0x29,0xf3,0x05,0x8b,0xc8,0x94,0x0a,0xd1,0x64,0xca,0x7d,0x6b,0x9a,0x4c};
    mont256_from_bytes(&ctx, base, base0);
    uint256_from_bytes(exponent, exponent0);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power0, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base1[32]     = {0x6c,0xad,0x4a,0x26,0x8d,0x11,0x6e,0xce,0x17,0x38,0xf7,0xd9,0x3d,0x9c,0x17,0x24,0x11,0xe2,0x0b,0x8f,0x6b,0x0d,0x54,0x9b,0x6f,0x03,0x67,0x5a,0x16,0x00,0xa3,0x5a};
    std::uint8_t exponent1[32] = {0x38,0x98,0xd1,0x90,0xf9,0xeb,0xda,0xcc,0x0c,0xb1,0xe2,0x9c,0x65,0x8c,0xda,0x14,0x95,0xe6,0x0a,0xf5,0x93,0xbd,0x04,0xcf,0x0f,0xd6,0x30,0xf1,0xf2,0x9d,0x0d,0xa9};
    std::uint8_t power1[32]    = {0xe8,0x3a,0x39,0x81,0x16,0xa0,0xd0,0x85,0x0d,0x7e,0x5a,0x2d,0xb3,0x18,0x6a,0x7f,0x9c,0x0b,0xc5,0x0a,0xef,0xa8,0x57,0x78,0x46,0x46,0x77,0x29,0x3e,0x4f,0x44,0x0e};
    mont256_from_bytes(&ctx, base, base1);
    uint256_from_bytes(exponent, exponent1);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power1, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base2[32]     = {0x1e,0x27,0xa1,0xc0,0x8a,0x6a,0x63,0xec,0x24,0xed,0xe6,0xa4,0x6b,0x4c,0xb2,0x42,0x4a,0x23,0xd5,0x96,0x22,0x17,0xbe,0xad,0xdb,0xc4,0x96,0xcb,0x8e,0x81,0x97,0x3e};
    std::uint8_t exponent2[32] = {0x90,0x7a,0x70,0xc3,0x10,0x12,0xf0,0x37,0xb6,0x4c,0xe4,0x22,0x8c,0x38,0xfb,0x29,0x18,0xf1,0x35,0xd2,0x5f,0x55,0x72,0x03,0x30,0x18,0x50,0xc5,0xa3,0x8f,0xd5,0x47};
    std::uint8_t power2[32]    = {0xda,0x59,0xbd,0x3a,0x4f,0x69,0x6d,0x71,0xee,0xa0,0x56,0x9b,0x92,0x93,0xa6,0x42,0x92,0x31,0x2d,0x85,0x56,0x8d,0xaa,0x44,0x20,0xda,0xf0,0x4e,0x9e,0x83,0xf8,0x07};
    mont256_from_bytes(&ctx, base, base2);
    uint256_from_bytes(exponent, exponent2);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power2, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base3[32]     = {0x50,0x6b,0xf2,0xef,0xc6,0xf8,0x77,0x18,0x6d,0x76,0xb0,0x7e,0x88,0x1e,0xd1,0x62,0xae,0x2e,0xb1,0x54,0x7f,0x15,0x05,0x24,0x34,0xb9,0xb5,0xdf,0x9e,0x77,0x69,0xb1};
    std::uint8_t exponent3[32] = {0xcb,0x5c,0x74,0x27,0x3f,0x98,0xe2,0x77,0x4c,0xbd,0x87,0xad,0x5c,0x90,0xa9,0x58,0x74,0x03,0xe4,0x30,0xec,0x66,0xa7,0x87,0x95,0xe7,0x61,0xd1,0x77,0x31,0xaf,0x10};
    std::uint8_t power3[32]    = {0x99,0x97,0xd3,0xfa,0x3a,0x46,0x1b,0x40,0xe7,0x39,0x6f,0x85,0xaf,0xb9,0xc7,0x45,0x62,0x78,0xbf,0x95,0x33,0x14,0xc0,0x6f,0xc3,0xf3,0x40,0x53,0xfc,0x9b,0xb8,0xcf};
    mont256_from_bytes(&ctx, base, base3);
    uint256_from_bytes(exponent, exponent3);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power3, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base4[32]     = {0x7e,0xbf,0xf2,0x06,0x86,0x73,0x47,0x21,0x4c,0xdd,0x20,0x55,0x93,0x0d,0x6e,0xaf,0x14,0xf4,0x73,0x3f,0x3e,0x7d,0x1b,0xfb,0xc7,0xa2,0xea,0x20,0xb2,0xf1,0x4c,0x94};
    std::uint8_t exponent4[32] = {0x12,0xbd,0x4a,0xce,0xfa,0xec,0xbd,0x38,0x9b,0xe4,0xbc,0xfc,0x49,0xb6,0x4a,0x08,0x72,0xe6,0xcc,0x3a,0xba,0xbc,0xed,0x20,0x57,0xee,0x05,0xcd,0xe0,0x09,0x02,0xc7};
    std::uint8_t power4[32]    = {0x2f,0x62,0xbb,0x81,0x5a,0x9b,0x66,0x59,0xa9,0x64,0xb2,0x4d,0x88,0xba,0xcc,0x50,0x6d,0x71,0x05,0x12,0xcf,0xcf,0xe6,0xda,0x7d,0xf1,0xf1,0xf2,0x1d,0x49,0x0c,0xbf};
    mont256_from_bytes(&ctx, base, base4);
    uint256_from_bytes(exponent, exponent4);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power4, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base5[32]     = {0x7d,0x2c,0xaf,0x82,0xee,0xea,0xcb,0xe2,0x26,0xe8,0x75,0x55,0x57,0x90,0xf8,0x2e,0xc1,0xd3,0xfc,0xff,0x2a,0x3a,0xf4,0xd4,0x6b,0x0a,0x18,0xe8,0x83,0x0e,0x07,0xbc};
    std::uint8_t exponent5[32] = {0xab,0x2c,0xd3,0x1e,0xe3,0x15,0x12,0x88,0x62,0xc3,0x3a,0x4f,0xb7,0x74,0xeb,0x52,0x48,0xdb,0x40,0xaf,0x72,0x15,0x83,0x70,0xd2,0x69,0xa9,0xa5,0xae,0x65,0x8f,0x33};
    std::uint8_t power5[32]    = {0xc1,0x6a,0x01,0xa7,0xc9,0x9b,0xb2,0xf3,0xe9,0x89,0x4a,0x7b,0x5e,0xbb,0x37,0x95,0x44,0x95,0x83,0xfa,0x32,0x96,0xfd,0x91,0x09,0xdb,0xeb,0xf9,0x16,0xa8,0xe3,0xe8};
    mont256_from_bytes(&ctx, base, base5);
    uint256_from_bytes(exponent, exponent5);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power5, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base6[32]     = {0x7e,0x62,0xaa,0x0a,0x1d,0xf9,0xfd,0x78,0x9c,0x65,0x39,0x38,0x2b,0x05,0x37,0xe6,0x5a,0xff,0xb2,0x29,0x76,0x31,0xa9,0x92,0xf0,0xce,0x58,0x35,0x05,0xc6,0xaf,0x07};
    std::uint8_t exponent6[32] = {0x65,0xdc,0x9f,0x50,0x3f,0x63,0xaf,0x83,0xbd,0x05,0x61,0xe6,0x21,0x1c,0x70,0xcf,0x49,0x95,0x23,0x99,0xc4,0xaa,0xea,0xc1,0x37,0xdc,0x76,0xfb,0x0f,0x17,0xa3,0x00};
    std::uint8_t power6[32]    = {0x34,0x08,0x32,0x95,0x47,0x06,0x7e,0xac,0x6f,0xe2,0xd2,0x9c,0xe5,0x15,0xc5,0xf3,0x94,0xe5,0xb2,0xee,0x1d,0x84,0xca,0xa5,0x00,0xaa,0xb2,0x68,0xd8,0xd7,0xc3,0x26};
    mont256_from_bytes(&ctx, base, base6);
    uint256_from_bytes(exponent, exponent6);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power6, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base7[32]     = {0x8c,0xa8,0x18,0x11,0x66,0xd2,0x28,0x76,0x72,0xfd,0xf2,0x02,0x2a,0x96,0xfb,0x1a,0x14,0xa0,0xf9,0xe7,0x7f,0x1b,0x10,0x3c,0xdf,0x15,0x82,0xb0,0xea,0xb4,0x77,0xd2};
    std::uint8_t exponent7[32] = {0x3b,0x12,0x87,0xff,0xf5,0x2d,0xdf,0x5d,0x61,0x64,0x99,0xc9,0xe2,0x5a,0x76,0x05,0xae,0xc6,0xf0,0x24,0x5b,0xd8,0x6d,0x40,0xfc,0x89,0x1b,0x4a,0x6a,0x50,0xdf,0x4d};
    std::uint8_t power7[32]    = {0x63,0x24,0xf0,0x21,0x7b,0xae,0x15,0x35,0xeb,0x68,0x30,0xbd,0xba,0xfa,0xce,0xdd,0xe8,0xb1,0xae,0xb9,0xa0,0x16,0x8f,0x54,0x2f,0x66,0xa7,0xa3,0x98,0x28,0x56,0x7b};
    mont256_from_bytes(&ctx, base, base7);
    uint256_from_bytes(exponent, exponent7);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power7, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base8[32]     = {0x7c,0x26,0x84,0x7f,0x03,0x16,0x90,0x9e,0x3b,0xbb,0xe9,0xea,0xa8,0x94,0x8c,0x89,0x3b,0x61,0x86,0x76,0x26,0xbb,0x7d,0xbd,0x2d,0x1c,0x9a,0xf0,0x15,0x3e,0x7c,0x2a};
    std::uint8_t exponent8[32] = {0x65,0xe7,0xe4,0x23,0x64,0x72,0xf1,0xa3,0x8f,0x2c,0x6e,0xc8,0xcc,0x41,0x69,0xa3,0xae,0x3a,0x2b,0x7f,0xdf,0xe0,0x18,0x93,0xf3,0xae,0xd0,0xb6,0xc7,0xac,0x14,0x91};
    std::uint8_t power8[32]    = {0xf3,0xcf,0xff,0x3e,0xf5,0xb6,0xb5,0x74,0x58,0x7a,0x4b,0x56,0x66,0x93,0x70,0x75,0xf2,0x32,0x66,0x8f,0x0a,0x27,0x4a,0x39,0xa1,0x85,0x7a,0x29,0x8e,0xfd,0x9c,0xcd};
    mont256_from_bytes(&ctx, base, base8);
    uint256_from_bytes(exponent, exponent8);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power8, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base9[32]     = {0x11,0x3d,0xb1,0x7d,0x30,0xcb,0xc9,0x7d,0x0f,0xef,0x79,0x28,0x66,0x83,0x68,0x86,0xa2,0x60,0xcd,0x0b,0x7b,0x45,0x14,0x5c,0x1a,0x81,0x68,0x2c,0x64,0xe5,0x0c,0xad};
    std::uint8_t exponent9[32] = {0x0d,0x75,0x98,0x5d,0x99,0xc9,0x43,0x09,0x57,0x0d,0xc1,0x95,0x1c,0x24,0x42,0xf9,0x29,0x8c,0xb3,0xa5,0x70,0xcc,0xec,0x31,0x35,0x71,0x81,0x0a,0xfc,0x13,0x2d,0x0d};
    std::uint8_t power9[32]    = {0xea,0x1a,0xa2,0xad,0x0e,0x6c,0xd9,0x4c,0x5c,0x61,0x0d,0x44,0x58,0xed,0xaf,0xf8,0xbe,0xaa,0x45,0xea,0x87,0xd5,0x34,0xb0,0xc8,0x52,0xfa,0x44,0x09,0x67,0xb7,0x0f};
    mont256_from_bytes(&ctx, base, base9);
    uint256_from_bytes(exponent, exponent9);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power9, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base10[32]     = {0x9d,0x1d,0xe2,0xa0,0x5d,0x15,0x8a,0x2f,0xf2,0xee,0x4e,0x45,0x19,0xf9,0x91,0x9c,0x89,0x5f,0xd7,0xb3,0x26,0xb9,0x4c,0x7f,0x91,0x18,0xbb,0x16,0x00,0x0f,0x49,0xc8};
    std::uint8_t exponent10[32] = {0xa2,0x68,0xaa,0x87,0x26,0x07,0x67,0x9d,0x60,0x50,0x91,0x4a,0x9d,0x33,0xa0,0x1c,0x35,0x3c,0x63,0x1c,0xdf,0xd4,0x3f,0x37,0x12,0x00,0x33,0x9d,0x06,0x87,0x39,0xfa};
    std::uint8_t power10[32]    = {0x33,0xd7,0x38,0xa1,0xa2,0x6f,0x82,0x1f,0x2a,0x58,0x21,0xf0,0x19,0xc2,0xd8,0x31,0x4b,0x7d,0xa4,0xdc,0x39,0x19,0x5d,0xa5,0xa1,0xd3,0x9e,0xa2,0x76,0xfc,0x5c,0x19};
    mont256_from_bytes(&ctx, base, base10);
    uint256_from_bytes(exponent, exponent10);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power10, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base11[32]     = {0xd9,0x53,0xee,0x26,0x1d,0x87,0xce,0xc3,0x1f,0x72,0x96,0xab,0x79,0x61,0xfd,0x92,0x5d,0x39,0xd0,0xa8,0x9a,0x2e,0xf8,0x0f,0x58,0xee,0x85,0x71,0xf4,0x99,0x8d,0x7c};
    std::uint8_t exponent11[32] = {0x15,0xfc,0x89,0x9e,0x4f,0xd5,0x8d,0xbe,0x7b,0xdc,0x96,0x8b,0x7a,0xfb,0x2c,0x68,0x77,0x4b,0x15,0xd7,0xfa,0x52,0x9b,0xa3,0xfe,0x3b,0xfa,0xda,0x7c,0xf2,0x07,0x24};
    std::uint8_t power11[32]    = {0xb9,0x94,0x74,0xa3,0xe8,0x30,0x49,0xa1,0xbf,0x84,0x35,0x24,0xb2,0x06,0x00,0xf1,0xa3,0x3a,0xd8,0x7c,0xde,0xba,0x60,0xee,0xaa,0x1c,0x86,0x10,0xaa,0x5e,0x59,0x41};
    mont256_from_bytes(&ctx, base, base11);
    uint256_from_bytes(exponent, exponent11);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power11, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base12[32]     = {0xb1,0x2a,0xa1,0xf6,0xd4,0x2f,0xdd,0xbb,0x7a,0x86,0xf7,0xa2,0x43,0xc7,0x1b,0x9a,0xbd,0x87,0xa8,0x65,0x57,0xb6,0xfb,0x7e,0xbf,0xea,0xa1,0x55,0x1a,0x28,0xf7,0xb3};
    std::uint8_t exponent12[32] = {0x5c,0x9b,0xcf,0x35,0x87,0x3b,0xe0,0x78,0xf3,0xb7,0xa5,0x0d,0xf3,0x73,0xca,0x53,0x34,0x88,0xf8,0x76,0x05,0xe9,0x99,0xf3,0x84,0x2e,0x7f,0xc2,0x29,0x54,0x0a,0x6e};
    std::uint8_t power12[32]    = {0x6f,0xbc,0xb8,0x9a,0x6a,0xdd,0x15,0x90,0x88,0xcf,0x33,0xc8,0xf6,0x46,0x00,0x74,0xfc,0x43,0x88,0xff,0x32,0x1f,0xfa,0xd3,0x5e,0x1e,0x80,0x87,0x15,0x6f,0x2f,0xa8};
    mont256_from_bytes(&ctx, base, base12);
    uint256_from_bytes(exponent, exponent12);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power12, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base13[32]     = {0xfa,0x7f,0x0e,0xab,0x4c,0x4f,0x9b,0x06,0x87,0x32,0x2e,0x25,0xc2,0x15,0xa8,0x2a,0x06,0xec,0x41,0xad,0xea,0x05,0x75,0x43,0x8b,0x0d,0x59,0x0b,0xb0,0xa8,0x44,0xe5};
    std::uint8_t exponent13[32] = {0x80,0xb0,0xc0,0x8b,0xc7,0x70,0x24,0x20,0x8a,0xa4,0x24,0x8c,0x88,0x57,0xf9,0xa4,0x39,0x08,0xf2,0x27,0xc5,0x9d,0xb9,0x16,0x5b,0x0e,0xe7,0x6f,0x2a,0xc3,0x44,0x46};
    std::uint8_t power13[32]    = {0x20,0x11,0x42,0x4f,0x67,0x1c,0xfa,0xad,0x55,0xac,0x28,0x2a,0xc7,0x11,0x1e,0xf2,0x95,0x58,0x4f,0x47,0xee,0x26,0x7a,0xae,0x45,0x4e,0x1a,0x2b,0x38,0xaa,0xc4,0x0d};
    mont256_from_bytes(&ctx, base, base13);
    uint256_from_bytes(exponent, exponent13);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power13, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base14[32]     = {0xda,0x45,0xe1,0x8a,0xc2,0x21,0x6b,0x02,0xfc,0x24,0x1d,0x0b,0xc9,0xd4,0x88,0xb1,0xcf,0xbf,0x33,0x60,0x9c,0xfc,0x86,0x52,0x39,0x19,0x42,0x42,0xa2,0xed,0xdb,0xbd};
    std::uint8_t exponent14[32] = {0x3a,0x0b,0x99,0x65,0xcd,0xa6,0xc6,0xfd,0xbd,0x68,0x51,0x67,0x66,0x93,0x40,0x36,0xd1,0x7e,0x44,0x97,0x3d,0x48,0x82,0xa5,0xce,0x5b,0x2a,0x92,0x31,0xf5,0x17,0x07};
    std::uint8_t power14[32]    = {0xb7,0xb1,0x0a,0x6b,0xf5,0xc5,0x98,0x7c,0x8f,0xed,0x94,0x1f,0x8a,0x8b,0x21,0xe8,0x95,0x8c,0xfc,0x20,0x8e,0xb8,0x51,0x8b,0x38,0x6b,0x66,0x82,0x18,0x37,0x25,0xf3};
    mont256_from_bytes(&ctx, base, base14);
    uint256_from_bytes(exponent, exponent14);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power14, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base15[32]     = {0xca,0x44,0xeb,0x86,0x07,0x26,0xe2,0x5c,0xfd,0x56,0xa9,0x26,0x07,0x6b,0x3e,0x36,0xbb,0x23,0x13,0xf5,0x5b,0x06,0x25,0x8e,0x7e,0x26,0xf3,0x6a,0x84,0x83,0xf8,0xb8};
    std::uint8_t exponent15[32] = {0x58,0x22,0xcb,0x77,0xf4,0xde,0x2c,0x08,0x9a,0xea,0x64,0x29,0xb1,0x49,0x1e,0x24,0x31,0x92,0xb7,0x04,0x42,0x59,0x40,0x52,0x78,0xe4,0xb9,0x8d,0x47,0x87,0xf9,0x3b};
    std::uint8_t power15[32]    = {0x16,0x61,0xdd,0x63,0x14,0x2f,0xf8,0xe8,0x40,0x3e,0x63,0xfb,0xce,0xfd,0x3f,0xfa,0x82,0xfe,0x6e,0xdd,0x25,0xdb,0x3e,0x4b,0x60,0x7a,0xbf,0xf3,0x82,0x97,0xd4,0x3b};
    mont256_from_bytes(&ctx, base, base15);
    uint256_from_bytes(exponent, exponent15);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power15, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base16[32]     = {0x5d,0x58,0xc7,0x05,0xf9,0x79,0xd0,0x4a,0xf4,0x7a,0xeb,0xdd,0x59,0x7a,0x1e,0xcf,0xfc,0xf0,0x0f,0xec,0xb9,0x1e,0xe9,0xe5,0xef,0xe0,0x9f,0x07,0xce,0xfe,0x2a,0x1f};
    std::uint8_t exponent16[32] = {0x34,0x51,0xd0,0x13,0x56,0x75,0xf6,0xad,0x32,0x5b,0x55,0xdd,0x78,0x57,0x29,0x76,0x3a,0x12,0x91,0x7c,0x1a,0x26,0xf8,0x89,0x38,0x70,0x38,0x00,0x14,0x9e,0x25,0x9b};
    std::uint8_t power16[32]    = {0xf2,0x66,0x6c,0x05,0xea,0x0c,0xe2,0x03,0x01,0xf7,0x00,0xf6,0x8f,0x79,0xf0,0x9e,0xa9,0xc2,0x37,0xa1,0xde,0x6b,0xd8,0x97,0x2c,0x4a,0x86,0x1f,0xe9,0x0c,0x9b,0x51};
    mont256_from_bytes(&ctx, base, base16);
    uint256_from_bytes(exponent, exponent16);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power16, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base17[32]     = {0xe8,0xc1,0x47,0x43,0x7a,0xbe,0xc5,0x39,0x00,0x7d,0x10,0x34,0xd7,0x26,0xc8,0x6b,0x9c,0x3a,0x23,0xcd,0xe6,0x7a,0x9b,0x75,0xfc,0x39,0x47,0x24,0x9f,0xc2,0xd0,0xa1};
    std::uint8_t exponent17[32] = {0x2d,0xb3,0x99,0x7f,0xe3,0x96,0x39,0xbe,0x7a,0x60,0x5a,0x91,0x33,0x06,0x98,0xa1,0xc0,0x09,0x34,0x92,0xb6,0x24,0x67,0x71,0xc8,0x45,0x00,0x70,0x63,0x77,0x14,0x07};
    std::uint8_t power17[32]    = {0x7e,0x83,0x98,0x1e,0xff,0x5d,0xde,0x18,0xc3,0x9a,0x74,0x71,0x78,0xd1,0x40,0x75,0x69,0xb8,0x77,0xe3,0x95,0x55,0x0c,0x3d,0xa9,0xf9,0x3a,0x36,0x44,0x16,0x4c,0x2f};
    mont256_from_bytes(&ctx, base, base17);
    uint256_from_bytes(exponent, exponent17);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power17, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base18[32]     = {0xb8,0xc9,0x81,0x7a,0xf8,0xbe,0x88,0x31,0xf2,0x37,0xe4,0x5a,0xcd,0x02,0xc5,0xe1,0x16,0x35,0x3d,0x03,0x55,0x1f,0xd8,0xf9,0xa2,0xc6,0x8e,0x45,0xca,0x04,0xc7,0x9f};
    std::uint8_t exponent18[32] = {0x28,0xaa,0xca,0x51,0xb9,0x8c,0x67,0xc2,0x15,0xbd,0x44,0x8f,0xf2,0x61,0x49,0xed,0xbe,0x4c,0x5c,0xe6,0x66,0xc1,0x49,0x4e,0x76,0x91,0xb0,0x6f,0x65,0x55,0xab,0xfe};
    std::uint8_t power18[32]    = {0xda,0xc8,0x4d,0xed,0x95,0xe3,0xa1,0xe3,0xf0,0x16,0x12,0xe2,0xcd,0xad,0x5a,0x8f,0x05,0x9a,0xff,0xd4,0x5b,0x7b,0x85,0x57,0x3a,0x36,0x4f,0x5c,0x3d,0x32,0xca,0xb9};
    mont256_from_bytes(&ctx, base, base18);
    uint256_from_bytes(exponent, exponent18);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power18, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base19[32]     = {0xce,0x76,0xe9,0xf4,0x77,0x21,0x6e,0x9e,0xe7,0xa4,0x63,0x09,0x97,0x3f,0x79,0x86,0x26,0xb1,0xcf,0xfc,0x07,0x0d,0x71,0x09,0x20,0x85,0x96,0x34,0xfe,0x3c,0x9c,0x8f};
    std::uint8_t exponent19[32] = {0x36,0x78,0xbc,0x8d,0x40,0x78,0x3f,0x0a,0x07,0x2a,0x98,0xd2,0x36,0x06,0xde,0xfc,0xdf,0xb8,0x5c,0x0d,0xd3,0x7e,0xe9,0x15,0x31,0xde,0xc4,0xf4,0xdf,0x2a,0x8b,0x79};
    std::uint8_t power19[32]    = {0xe4,0xf2,0x39,0x14,0x40,0xbd,0xc2,0x85,0x8e,0x1a,0xc2,0xa6,0xf7,0x73,0xe1,0xf2,0xc2,0xe8,0x6c,0xeb,0xa3,0x52,0xf4,0x0e,0x6b,0x26,0x17,0x07,0xeb,0xe1,0x24,0x59};
    mont256_from_bytes(&ctx, base, base19);
    uint256_from_bytes(exponent, exponent19);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power19, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base20[32]     = {0x6b,0x44,0x68,0x06,0x8b,0x5a,0xb3,0xee,0x42,0x65,0xbb,0x31,0x53,0x74,0x09,0x02,0x96,0x20,0xbf,0x0d,0xc3,0x80,0x84,0xa0,0x3d,0x93,0xfd,0x4c,0x80,0x4c,0x25,0xd6};
    std::uint8_t exponent20[32] = {0x24,0x3d,0x35,0x70,0x2c,0x1e,0xea,0x1f,0x26,0x59,0x74,0xa7,0xcc,0x96,0x6f,0x46,0xc6,0xaa,0x7d,0x55,0x01,0x01,0xb8,0x11,0x9b,0xca,0x3c,0xb7,0x2e,0xe0,0x28,0x9d};
    std::uint8_t power20[32]    = {0xf9,0xd4,0x21,0x0b,0x5a,0xb3,0x04,0x53,0x66,0x3c,0x74,0x1f,0xb8,0x1b,0x6d,0x2f,0xe1,0x7e,0xa8,0x7e,0x66,0x76,0xbf,0x86,0xd9,0x4c,0xb8,0x66,0x7e,0x23,0x92,0x1b};
    mont256_from_bytes(&ctx, base, base20);
    uint256_from_bytes(exponent, exponent20);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power20, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base21[32]     = {0x84,0xb2,0x80,0x54,0xae,0xad,0x44,0xb0,0x53,0x73,0x90,0xe5,0x0f,0xcf,0x31,0xca,0x8e,0x75,0x2f,0xdf,0x1e,0xce,0x61,0x5d,0xb9,0xa6,0x44,0x2e,0x9e,0x7d,0x6b,0x37};
    std::uint8_t exponent21[32] = {0x8f,0x6f,0x91,0x5f,0xe2,0x1b,0x37,0xca,0x1b,0x29,0xfc,0x99,0xc6,0xc8,0x0e,0x2b,0xc8,0xc6,0x14,0xb2,0x7b,0x84,0x44,0xd1,0x8e,0x31,0x70,0x41,0x87,0xdd,0xae,0xb7};
    std::uint8_t power21[32]    = {0xf0,0x87,0xfa,0xc6,0x5b,0x46,0x4f,0xc7,0x31,0x55,0x6a,0x55,0x32,0x8e,0x0a,0xbe,0x7a,0xff,0x36,0x97,0x79,0x8c,0x25,0xba,0xce,0x8d,0x6a,0xb6,0x13,0x96,0xe7,0x8c};
    mont256_from_bytes(&ctx, base, base21);
    uint256_from_bytes(exponent, exponent21);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power21, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base22[32]     = {0x73,0xc1,0xcd,0x2c,0x81,0xf9,0x8b,0x52,0x19,0x05,0xd5,0x91,0xc5,0xb2,0xe7,0x5a,0x0a,0xcd,0x8b,0xe1,0x46,0xe4,0x09,0x90,0x30,0xf9,0x70,0x58,0x3f,0x9d,0x52,0xf9};
    std::uint8_t exponent22[32] = {0xf1,0x79,0xf2,0xd2,0xe4,0x8b,0x96,0x62,0x8f,0x3c,0x4b,0xe3,0xec,0x3b,0x96,0x05,0x42,0x74,0xa3,0xeb,0xed,0x84,0xe9,0x1e,0xf1,0x32,0xbf,0x2d,0xe0,0x40,0x01,0x5c};
    std::uint8_t power22[32]    = {0x0f,0x4c,0x1f,0xc5,0x2e,0xd3,0xd7,0xbf,0x3b,0xcd,0x9c,0x99,0x8b,0x62,0x9b,0x72,0x85,0x61,0x6d,0xa1,0xe4,0x6a,0x95,0xd8,0x2a,0x8c,0x11,0x56,0x60,0x82,0xb5,0x1f};
    mont256_from_bytes(&ctx, base, base22);
    uint256_from_bytes(exponent, exponent22);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power22, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base23[32]     = {0x50,0xe4,0x0d,0x54,0x71,0x2e,0xa6,0xb3,0x64,0x71,0xfd,0xe4,0x1f,0x22,0x9d,0xd0,0x6a,0xa8,0xb9,0xe0,0x23,0x1b,0x3e,0x14,0x72,0x91,0x35,0xbd,0xd7,0x0a,0x39,0xd1};
    std::uint8_t exponent23[32] = {0xa9,0x06,0x92,0x2f,0xa4,0xb9,0xa9,0xc4,0xb7,0x53,0xa1,0xee,0xf0,0x83,0x60,0x85,0x27,0x89,0xd0,0x59,0xc6,0xe5,0x0d,0xf2,0xe5,0xa3,0x86,0x3e,0x1f,0x52,0x52,0x65};
    std::uint8_t power23[32]    = {0x3b,0x1a,0xb2,0x42,0x3b,0xbe,0x09,0xd4,0x92,0x31,0x5e,0xdb,0xfd,0xf1,0xfb,0xea,0x39,0x7f,0xe2,0x41,0x7b,0x0a,0x71,0x7c,0x83,0xce,0x99,0x36,0x8a,0xe7,0xaa,0x87};
    mont256_from_bytes(&ctx, base, base23);
    uint256_from_bytes(exponent, exponent23);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power23, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base24[32]     = {0xbf,0x26,0x8e,0xa0,0x38,0x36,0xe8,0x65,0x77,0xbd,0x89,0x1f,0xf7,0xb1,0x03,0xdf,0x23,0x23,0x1e,0x1e,0xe2,0x01,0x55,0x22,0x40,0xcb,0xac,0xd0,0x24,0x9a,0x45,0x84};
    std::uint8_t exponent24[32] = {0x56,0xd0,0x50,0xcd,0x67,0x60,0x13,0x67,0x83,0xfe,0xb1,0x7b,0xfe,0x7b,0x8a,0xe4,0x6e,0x78,0x36,0xa4,0xb4,0xd1,0x9e,0xc1,0x29,0x55,0xd6,0xf0,0x39,0x45,0x33,0x6b};
    std::uint8_t power24[32]    = {0xf4,0x48,0x77,0x24,0x38,0xf7,0xf9,0xf4,0x90,0xe5,0xb9,0x57,0x02,0x09,0x09,0xb2,0x33,0xfb,0x75,0x93,0xae,0x78,0x31,0x2d,0x3f,0x4d,0x54,0xbe,0x92,0x3e,0xe3,0xad};
    mont256_from_bytes(&ctx, base, base24);
    uint256_from_bytes(exponent, exponent24);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power24, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base25[32]     = {0x56,0x85,0xd6,0x24,0x04,0xfc,0xd5,0x55,0x5d,0xaf,0x10,0x6d,0xb8,0xde,0xe0,0x81,0x17,0x9a,0x07,0x1e,0x51,0x8a,0xe4,0x52,0x5b,0x4b,0x1b,0x75,0x32,0x1c,0x52,0x96};
    std::uint8_t exponent25[32] = {0xc9,0xd2,0x29,0x50,0xeb,0x25,0xf8,0xa1,0xfc,0x2e,0x6a,0x59,0x1c,0xe3,0xbc,0x0c,0x10,0x75,0x5c,0x97,0xf5,0xf5,0x54,0xed,0x83,0x23,0x9e,0xf5,0x4b,0xa2,0xe1,0x61};
    std::uint8_t power25[32]    = {0xd9,0x80,0xa4,0x30,0xb6,0x18,0x1d,0x1d,0x52,0xa8,0xee,0xa4,0xb2,0x78,0xe5,0x50,0x62,0x7f,0x30,0xde,0x7c,0x45,0x94,0x1f,0xb4,0xdd,0xba,0xbf,0x46,0xe0,0xa1,0x09};
    mont256_from_bytes(&ctx, base, base25);
    uint256_from_bytes(exponent, exponent25);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power25, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base26[32]     = {0xe7,0xe8,0xf9,0xf6,0x0a,0x22,0x73,0x85,0x45,0x9c,0x94,0x5c,0x43,0xfc,0x05,0x27,0x15,0x85,0x0a,0x03,0x1a,0xd2,0xd5,0xf1,0xe0,0x5b,0x3e,0x13,0xf8,0xc1,0x10,0xfb};
    std::uint8_t exponent26[32] = {0xa2,0x6a,0xa0,0xae,0x04,0x4f,0x15,0x74,0xf0,0x37,0xaf,0xc6,0x44,0xd8,0x2a,0x53,0x12,0x89,0xba,0xfa,0xe5,0x31,0x69,0x60,0x6c,0xe1,0x93,0xc2,0x2e,0xef,0xa2,0x79};
    std::uint8_t power26[32]    = {0xa2,0x41,0xdc,0xc6,0x31,0x2b,0x49,0x3d,0xed,0xdd,0x7d,0x14,0xcf,0x6a,0x34,0x30,0xaa,0xcc,0xb4,0x63,0x25,0xc1,0xa4,0x80,0x66,0x97,0x92,0xa4,0x63,0x81,0x57,0xd4};
    mont256_from_bytes(&ctx, base, base26);
    uint256_from_bytes(exponent, exponent26);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power26, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base27[32]     = {0x43,0xb3,0x0f,0x66,0x11,0x0e,0x2c,0xb6,0x38,0xef,0xba,0xeb,0xdb,0x31,0xcc,0xd2,0x9b,0xb1,0x83,0xe1,0x15,0x70,0x26,0x6b,0x42,0xb3,0x87,0x55,0xcd,0x37,0x88,0x0e};
    std::uint8_t exponent27[32] = {0xee,0xa7,0xbb,0x64,0x33,0xa7,0x15,0x68,0x2e,0x5f,0x95,0x0c,0x0c,0xe5,0xaf,0x69,0x43,0x0b,0x91,0xed,0x29,0x54,0xba,0x5c,0xf8,0x1e,0x54,0xdd,0x1c,0x05,0x02,0xc6};
    std::uint8_t power27[32]    = {0xa4,0x7c,0x51,0x2f,0x4b,0xf2,0xaa,0xf5,0x77,0x12,0xaa,0x9d,0x71,0xf2,0xa9,0x7e,0xb9,0x1e,0xdd,0x7b,0x8a,0x90,0x35,0xdf,0xa9,0x4a,0x06,0xf4,0x54,0xe2,0xa8,0xe4};
    mont256_from_bytes(&ctx, base, base27);
    uint256_from_bytes(exponent, exponent27);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power27, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base28[32]     = {0x80,0x05,0xce,0x74,0x72,0x18,0x88,0xff,0x4a,0x3a,0xdf,0x99,0x34,0xb3,0xff,0x60,0xc2,0x6e,0x7a,0x42,0x87,0xf5,0x3d,0xdd,0x4e,0x14,0xd5,0x71,0xa0,0xf0,0x96,0xda};
    std::uint8_t exponent28[32] = {0x40,0x1d,0x68,0xfb,0xfe,0x97,0x7c,0x56,0x04,0xa6,0x56,0x51,0xcd,0xbd,0xe7,0x47,0x58,0xd5,0x0f,0x1b,0x45,0x40,0xf4,0x26,0x2d,0x8a,0xd8,0xc0,0xac,0x12,0x7e,0x93};
    std::uint8_t power28[32]    = {0x86,0x04,0xd0,0x1c,0x92,0x87,0xbb,0xc1,0xca,0x83,0x43,0xcd,0xd4,0xf9,0x56,0x44,0xe0,0x43,0x01,0xce,0x3c,0x38,0x42,0xa2,0xc9,0x75,0x6a,0x4a,0x16,0x28,0x60,0x97};
    mont256_from_bytes(&ctx, base, base28);
    uint256_from_bytes(exponent, exponent28);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power28, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base29[32]     = {0x83,0xa4,0xe6,0x29,0x30,0x80,0x38,0x89,0xfa,0x61,0x97,0x74,0x8d,0x11,0x8e,0x37,0x81,0x72,0x8a,0x07,0xbb,0xab,0x27,0xf6,0x04,0xb8,0x15,0x7d,0x03,0xed,0xb9,0x20};
    std::uint8_t exponent29[32] = {0xa6,0x6d,0x58,0xb5,0xd1,0xa4,0xc0,0x1e,0xa8,0x87,0xae,0x22,0x1b,0x35,0x41,0x1b,0x72,0x72,0x3b,0x9c,0xef,0x44,0xc0,0xd5,0x3e,0xe4,0xda,0x5a,0x79,0x89,0xe9,0xd0};
    std::uint8_t power29[32]    = {0xb0,0x31,0x4b,0x4e,0x9f,0x98,0xd4,0x3d,0x26,0xc4,0xb7,0x7b,0x9b,0xca,0xc3,0xbf,0x58,0x91,0xde,0x5a,0xe0,0xdc,0xd3,0x0d,0xff,0xae,0x54,0xd3,0xf3,0x51,0x00,0x84};
    mont256_from_bytes(&ctx, base, base29);
    uint256_from_bytes(exponent, exponent29);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power29, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base30[32]     = {0x81,0xb6,0x2b,0xb5,0xf8,0x66,0x64,0xae,0x64,0xa1,0x49,0xf5,0xe3,0x83,0x8b,0x9e,0xd5,0xa9,0x42,0x2a,0x8b,0xc0,0x83,0x11,0x7e,0xb8,0x6c,0x57,0xa8,0x11,0x00,0xa1};
    std::uint8_t exponent30[32] = {0xfb,0x5c,0x9d,0x56,0x58,0xf9,0x2d,0xea,0xfd,0x4b,0xd0,0x30,0x67,0x9a,0x44,0xdd,0x23,0xc4,0x9c,0xae,0xa2,0xcf,0x62,0xba,0xba,0x95,0x88,0x10,0xb4,0xeb,0xf4,0xb6};
    std::uint8_t power30[32]    = {0xc8,0x57,0x78,0xda,0x56,0xb4,0xa6,0xc8,0x8e,0x50,0x4b,0x6a,0xf5,0x33,0xb3,0xbb,0x82,0xf6,0xa8,0x3d,0xaa,0x87,0x95,0xdf,0x6d,0x0f,0x57,0xf0,0x9e,0xd6,0xc8,0x41};
    mont256_from_bytes(&ctx, base, base30);
    uint256_from_bytes(exponent, exponent30);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power30, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base31[32]     = {0x41,0x6e,0x99,0xb0,0xe1,0x3e,0x21,0x3e,0xbd,0xaa,0xea,0x00,0xa0,0x1d,0x61,0x6f,0x12,0x1a,0xe3,0xe6,0x03,0xa6,0x39,0x66,0x21,0x3b,0xca,0x7f,0xd6,0x44,0xde,0x2f};
    std::uint8_t exponent31[32] = {0x0b,0x94,0xaf,0x3a,0x4b,0x05,0xe1,0xae,0xb1,0x53,0xd6,0x9c,0x3e,0x01,0xaa,0xa6,0x99,0x49,0x8a,0xc4,0x48,0x2c,0xc7,0x8e,0xf8,0x8e,0xde,0x10,0xab,0xa8,0xb9,0xb3};
    std::uint8_t power31[32]    = {0xc3,0x9f,0x36,0x78,0x08,0x89,0xc6,0x60,0x1e,0x33,0xf2,0x3f,0x2a,0xd5,0xbf,0xed,0x67,0x00,0x54,0xc2,0x6d,0xe3,0x62,0x1c,0x33,0x61,0x0b,0x89,0xe4,0x30,0x79,0xef};
    mont256_from_bytes(&ctx, base, base31);
    uint256_from_bytes(exponent, exponent31);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power31, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base32[32]     = {0xf6,0x37,0xa4,0x68,0x5d,0x38,0x5e,0x06,0x43,0x63,0xe5,0xd9,0x00,0xed,0x6b,0x02,0x72,0x21,0x8f,0xdc,0x44,0xdf,0x96,0xff,0x28,0x54,0x14,0x24,0x2f,0x73,0x3b,0x05};
    std::uint8_t exponent32[32] = {0x15,0x79,0xda,0x0a,0x61,0xb2,0x48,0x0c,0x55,0xd8,0x5e,0x8d,0x00,0x46,0x0d,0x69,0x2e,0xd6,0x54,0x11,0x5b,0x49,0x15,0x61,0x37,0xc6,0x0e,0x98,0x4f,0x3e,0x88,0x5e};
    std::uint8_t power32[32]    = {0x7e,0xae,0xb1,0x8b,0x39,0x6f,0x86,0xc3,0xc9,0xa3,0xcb,0xd7,0x63,0xd1,0xc6,0x7e,0x4f,0xff,0xbe,0xdc,0x28,0x85,0xee,0x97,0x89,0x09,0x76,0xaf,0xb7,0x01,0xcb,0xb4};
    mont256_from_bytes(&ctx, base, base32);
    uint256_from_bytes(exponent, exponent32);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power32, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base33[32]     = {0x01,0x44,0x70,0x2b,0xc6,0xb7,0x89,0xef,0x81,0x36,0x5a,0xcc,0x3f,0x88,0xaf,0x59,0x33,0x73,0x6d,0xcc,0xa7,0xf0,0xc9,0x9e,0x80,0xb5,0x24,0x4a,0x47,0x67,0xe1,0xfa};
    std::uint8_t exponent33[32] = {0x0a,0xaa,0xaf,0x81,0x96,0x38,0x92,0xa7,0x66,0x46,0x5d,0x28,0x24,0xd4,0x58,0x9c,0x16,0xfa,0x14,0x21,0xd1,0x29,0xd0,0x67,0x43,0xa0,0x8f,0x06,0x17,0x42,0x0e,0x94};
    std::uint8_t power33[32]    = {0x8e,0x4a,0xd7,0x37,0x07,0x56,0x43,0xef,0xc2,0x9f,0xc5,0x78,0x63,0x3d,0x97,0x64,0xed,0xd0,0x5d,0xdf,0x3e,0x12,0xd3,0x24,0xc5,0xd4,0xc9,0x98,0x59,0x35,0xae,0xf6};
    mont256_from_bytes(&ctx, base, base33);
    uint256_from_bytes(exponent, exponent33);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power33, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base34[32]     = {0xf5,0x27,0xb5,0xc2,0x95,0xe8,0xc9,0x3e,0x15,0xa0,0xa8,0xae,0x3b,0x99,0x68,0x70,0xa1,0x32,0x0b,0x9d,0x4d,0xe2,0xf8,0xad,0x4c,0xb5,0x9a,0xa7,0x05,0xc2,0x2d,0x3f};
    std::uint8_t exponent34[32] = {0x26,0x43,0x37,0x98,0x7e,0x83,0x49,0x04,0xfc,0x17,0x34,0x98,0xb8,0x7e,0x4e,0x2b,0x53,0x7d,0x91,0x28,0xc3,0xa9,0xe8,0x89,0x63,0xb7,0x59,0xf5,0x98,0xb8,0x1c,0x66};
    std::uint8_t power34[32]    = {0x51,0xc8,0x53,0xa8,0x5b,0xa8,0x27,0x00,0xbb,0xb4,0x9a,0x20,0xa6,0x8f,0x7a,0xad,0xcd,0x46,0xfc,0xc8,0x04,0x9c,0x7f,0xc1,0x80,0xeb,0x8d,0x2c,0x8d,0x37,0xc8,0x78};
    mont256_from_bytes(&ctx, base, base34);
    uint256_from_bytes(exponent, exponent34);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power34, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base35[32]     = {0xb7,0x0a,0xf5,0xf2,0xd5,0xd5,0x89,0x1f,0xd3,0x29,0xd6,0x5c,0x0b,0x35,0xb1,0xde,0x25,0x0e,0x7b,0x34,0xa4,0xaa,0x07,0xb4,0x9e,0x63,0x97,0xd4,0xb9,0x62,0x45,0xd3};
    std::uint8_t exponent35[32] = {0x81,0x6b,0x23,0x32,0xcf,0xed,0x94,0x3b,0xb3,0x78,0x3a,0x7c,0xbb,0xdd,0xbb,0x9b,0x6d,0xe2,0xfb,0x1f,0xa0,0x98,0xd6,0x91,0x83,0x52,0xbc,0x85,0xe4,0x56,0x55,0x9c};
    std::uint8_t power35[32]    = {0xdc,0xe6,0x48,0xb5,0x8d,0x21,0xe0,0xf3,0xb0,0x50,0xb9,0xd7,0x1d,0x5c,0x73,0x48,0xcc,0xa1,0xf8,0xc2,0x9a,0xe0,0xc4,0x20,0x97,0xdd,0xde,0xd4,0xfe,0x5d,0x08,0x6c};
    mont256_from_bytes(&ctx, base, base35);
    uint256_from_bytes(exponent, exponent35);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power35, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base36[32]     = {0xcd,0xff,0x5a,0x1c,0xd0,0x1a,0x91,0x4c,0xd5,0xbe,0x78,0x5a,0x91,0x87,0xdf,0x42,0x81,0x1e,0x76,0x16,0xc0,0xbb,0xe6,0xed,0x86,0x14,0xf5,0x04,0xe8,0xee,0x65,0xa1};
    std::uint8_t exponent36[32] = {0xa3,0x1a,0x49,0xdd,0x22,0x12,0x65,0x40,0x0a,0xb7,0x79,0x88,0x07,0xfa,0x22,0xf7,0x15,0xc8,0x91,0xff,0x3a,0xdd,0x65,0x27,0xa4,0x94,0x6d,0x15,0xb1,0x7d,0xd2,0x55};
    std::uint8_t power36[32]    = {0x86,0x40,0x4d,0xc8,0xc9,0x59,0xd5,0xdc,0x66,0x21,0xa4,0x74,0x9f,0x53,0xb3,0x2c,0x71,0x86,0x84,0x1d,0xd5,0x27,0xc0,0x2a,0xd0,0x72,0xf0,0x52,0xa5,0x51,0xc3,0xc3};
    mont256_from_bytes(&ctx, base, base36);
    uint256_from_bytes(exponent, exponent36);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power36, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base37[32]     = {0xa0,0xb5,0x58,0x64,0x0c,0xff,0xf0,0x54,0x8e,0xfb,0xa4,0x42,0x73,0x8e,0x0b,0x77,0xd5,0xf8,0x60,0xc3,0x60,0x6a,0x0d,0xeb,0x1a,0xdb,0xce,0x5d,0xf5,0xa2,0xd8,0x79};
    std::uint8_t exponent37[32] = {0x00,0xd9,0x35,0x34,0x43,0x87,0xee,0x7b,0x7d,0x42,0x64,0x6f,0x3e,0x9b,0x76,0x8f,0xae,0x40,0x01,0xe3,0x88,0x0c,0xb4,0x01,0xa0,0x50,0x60,0x98,0x04,0xd2,0xbe,0x09};
    std::uint8_t power37[32]    = {0xf6,0xd4,0xb5,0xc2,0x3a,0x01,0x01,0x01,0xb3,0x3a,0x2c,0x04,0x1c,0x76,0x92,0x75,0x2e,0x31,0xc8,0xab,0x73,0xca,0xa4,0xd0,0xcb,0x15,0x49,0x52,0xee,0xd8,0xc0,0x20};
    mont256_from_bytes(&ctx, base, base37);
    uint256_from_bytes(exponent, exponent37);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power37, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base38[32]     = {0x17,0x89,0x81,0x9f,0x89,0x02,0xda,0xfc,0xe5,0xd9,0xfe,0x81,0x80,0xc2,0xb5,0xf1,0xee,0xb8,0x9f,0xf1,0xbf,0x8e,0x51,0xaa,0x11,0xf2,0xd4,0x4d,0xcc,0x35,0xe8,0x34};
    std::uint8_t exponent38[32] = {0xcf,0x28,0xf6,0x5e,0x40,0x8f,0xc1,0x46,0x79,0x4e,0xc9,0x26,0xbc,0x9e,0x28,0xea,0xbe,0xe8,0x06,0x26,0x10,0xe8,0xad,0x01,0x86,0xa7,0x4a,0x63,0xa8,0xc7,0xd9,0xe0};
    std::uint8_t power38[32]    = {0xfa,0x38,0x27,0xc1,0x03,0x86,0xb8,0xfa,0x75,0xa7,0xa4,0x58,0xf2,0x67,0xc5,0x94,0xed,0x2c,0x72,0x73,0x0c,0xf5,0xbf,0x2a,0xe4,0x59,0x9c,0x04,0x7e,0xf5,0x8c,0x23};
    mont256_from_bytes(&ctx, base, base38);
    uint256_from_bytes(exponent, exponent38);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power38, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base39[32]     = {0xbd,0x65,0x68,0x0c,0x3b,0x11,0x85,0xd9,0x34,0x89,0x22,0xd7,0xc1,0xa6,0x24,0xdc,0xba,0xb5,0xb3,0x73,0x3c,0x1a,0xe9,0x17,0x43,0xfb,0x9f,0xbc,0xd8,0x9c,0x36,0xb2};
    std::uint8_t exponent39[32] = {0x32,0xc3,0x24,0x44,0xa4,0x8c,0x1d,0x5c,0xa1,0xfe,0xb6,0x24,0x9d,0xf2,0x02,0x5f,0x0b,0xf7,0xa4,0xbd,0xc4,0x58,0x27,0x2f,0x49,0x8d,0xbf,0xa8,0xaf,0x06,0xbc,0xf7};
    std::uint8_t power39[32]    = {0x1f,0xbc,0xdf,0x52,0x6e,0xee,0x6e,0xf4,0x3c,0x75,0x95,0x51,0x74,0x1d,0xea,0x4a,0xf6,0x9a,0xc3,0xbe,0x8f,0xb0,0x9e,0x24,0xa3,0x6a,0x97,0x42,0xae,0x59,0x88,0xe8};
    mont256_from_bytes(&ctx, base, base39);
    uint256_from_bytes(exponent, exponent39);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power39, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base40[32]     = {0x4d,0xee,0x48,0x12,0xb1,0x61,0x07,0xf1,0xbe,0x43,0x7c,0x7b,0xa6,0xca,0xf4,0xa3,0x41,0x02,0x3a,0xed,0x54,0xef,0x12,0x5a,0x25,0xbd,0xa6,0x59,0x99,0x86,0x48,0xe0};
    std::uint8_t exponent40[32] = {0x4a,0x22,0x7f,0x39,0x04,0x7b,0x2c,0x10,0x79,0x12,0xef,0x4a,0xef,0xae,0x5d,0x4e,0x15,0xfa,0x8b,0x65,0xfa,0x66,0x72,0xcd,0x4f,0xc9,0xe9,0x18,0x33,0x02,0x0c,0xcd};
    std::uint8_t power40[32]    = {0xde,0xc7,0x49,0x46,0xc9,0x31,0x93,0x64,0x5a,0xc6,0xd2,0xad,0x77,0x8b,0x08,0x1e,0xee,0x1e,0x76,0xd6,0xb6,0x88,0xd3,0x5f,0xae,0x2a,0xdb,0x67,0x64,0xa0,0xc3,0x0d};
    mont256_from_bytes(&ctx, base, base40);
    uint256_from_bytes(exponent, exponent40);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power40, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base41[32]     = {0x44,0xc6,0xb8,0x95,0xfe,0x74,0x9e,0x67,0x73,0x0f,0x37,0xf1,0xfe,0x9e,0xb4,0xad,0xf7,0xd5,0xf1,0x24,0x81,0xb1,0xc0,0x25,0xd1,0xe4,0xd0,0xa3,0x13,0x93,0x29,0x04};
    std::uint8_t exponent41[32] = {0x94,0xdb,0x5f,0x8f,0x13,0x19,0xd4,0x24,0x35,0xf1,0x03,0x00,0xee,0x37,0x9c,0x65,0xf2,0x12,0x01,0xe4,0xea,0xa3,0x55,0x6c,0x35,0xb7,0xe4,0x48,0x63,0x08,0x7e,0x52};
    std::uint8_t power41[32]    = {0x08,0x36,0x3a,0x9b,0xa8,0x43,0xf2,0x91,0x29,0x93,0xc8,0x81,0x59,0x1f,0x49,0x0f,0x04,0x17,0xc8,0x74,0x3f,0x09,0x4c,0xc2,0xf7,0x1a,0x8b,0x1e,0x35,0xfb,0x60,0x13};
    mont256_from_bytes(&ctx, base, base41);
    uint256_from_bytes(exponent, exponent41);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power41, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base42[32]     = {0x9a,0x76,0x2d,0x54,0x21,0xf2,0x67,0xe2,0x5c,0x0b,0xb4,0x0f,0xf3,0xe6,0xca,0x73,0x43,0x05,0xe9,0x86,0x86,0x29,0x2b,0xb5,0xbf,0x5b,0x41,0x1b,0x24,0x49,0x1d,0xf6};
    std::uint8_t exponent42[32] = {0x5d,0x7c,0xfe,0xd1,0xb4,0x0d,0xe5,0x6d,0x1c,0xd8,0x6f,0xc1,0xe3,0x09,0x66,0x19,0x47,0x91,0xc2,0xe9,0x82,0x3d,0x11,0xed,0xa1,0xb5,0x01,0xd6,0xd1,0xf9,0xbd,0xfe};
    std::uint8_t power42[32]    = {0x94,0x07,0xeb,0x20,0x6c,0x98,0x4f,0x8b,0xec,0xa1,0x7b,0x5f,0x7e,0x96,0x38,0x35,0x03,0x20,0x1a,0x3d,0xa5,0x08,0x87,0x17,0x8c,0x50,0x96,0xe9,0xd5,0xd5,0xc5,0xfb};
    mont256_from_bytes(&ctx, base, base42);
    uint256_from_bytes(exponent, exponent42);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power42, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base43[32]     = {0x00,0xeb,0x4e,0x11,0x28,0xb8,0x80,0x73,0x06,0x5b,0x8c,0x35,0x64,0xe2,0x76,0x02,0x7c,0x73,0xb6,0xc9,0xe0,0x4b,0x0d,0xce,0xe5,0xd0,0x0a,0x4d,0x7f,0x75,0x95,0xb5};
    std::uint8_t exponent43[32] = {0x24,0x05,0x63,0x60,0xba,0x28,0xa6,0x79,0x4d,0x4c,0xa9,0xc7,0x67,0xc9,0x8f,0xb9,0x73,0x65,0x06,0xec,0xae,0x7c,0x8f,0x09,0x7d,0xdf,0xcb,0xc9,0xf3,0x30,0x8c,0xe5};
    std::uint8_t power43[32]    = {0x7e,0x83,0x01,0xf0,0xdc,0x37,0x8a,0x9c,0xa0,0xe7,0x53,0x04,0x28,0xc7,0xc8,0x59,0x46,0xd9,0xa1,0x66,0x05,0x79,0xc8,0x12,0x31,0x7d,0x37,0xcd,0x01,0x8a,0x35,0xc5};
    mont256_from_bytes(&ctx, base, base43);
    uint256_from_bytes(exponent, exponent43);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power43, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base44[32]     = {0x53,0x15,0x8c,0xe4,0x00,0x72,0x1f,0x84,0x54,0xd1,0xac,0x6b,0xd7,0x19,0x61,0x89,0x1e,0xf3,0xea,0x44,0x50,0xea,0x7d,0xa7,0x60,0x48,0x7e,0x15,0x58,0x0d,0xc5,0xab};
    std::uint8_t exponent44[32] = {0x64,0x95,0x0d,0xc2,0x10,0xa2,0x5b,0x19,0x5f,0x49,0xf0,0xfc,0x40,0xd2,0x84,0x06,0x4a,0x32,0x7e,0x2d,0xbd,0x6a,0x99,0x6d,0xe6,0xcd,0x10,0xf1,0x03,0x00,0x30,0x05};
    std::uint8_t power44[32]    = {0x65,0x44,0x49,0x6e,0x45,0x5f,0x67,0x91,0x6e,0x58,0xe2,0xae,0xb4,0x05,0x76,0x65,0xa3,0x49,0xa4,0x6f,0xe8,0xf7,0x46,0xb3,0x7d,0x6c,0xec,0x21,0xd5,0x04,0xe4,0x09};
    mont256_from_bytes(&ctx, base, base44);
    uint256_from_bytes(exponent, exponent44);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power44, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base45[32]     = {0xc1,0x72,0xb2,0x98,0x6d,0x94,0xdd,0x6d,0xec,0xe8,0x07,0x99,0x5c,0x57,0x72,0x2e,0x13,0x8e,0xfe,0xf9,0x96,0xd4,0x48,0x0f,0xde,0xb6,0x7a,0xe7,0xff,0xb0,0xdd,0x9e};
    std::uint8_t exponent45[32] = {0xa9,0x77,0x66,0xfb,0xd5,0xad,0x53,0x60,0x0d,0x36,0xce,0x2c,0x1a,0x09,0xa8,0x40,0x47,0xd7,0xdf,0x79,0x0c,0x5b,0x4c,0x59,0xda,0xb0,0x79,0x29,0x46,0x70,0x93,0x12};
    std::uint8_t power45[32]    = {0xfc,0xcc,0x93,0x3e,0x37,0x32,0x1e,0x8f,0xf0,0x81,0xce,0xf2,0x0b,0x9e,0xcd,0x19,0x72,0x96,0xa8,0x37,0x6c,0x92,0x33,0x46,0x56,0xd4,0x82,0xc9,0x93,0xb6,0x9a,0x60};
    mont256_from_bytes(&ctx, base, base45);
    uint256_from_bytes(exponent, exponent45);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power45, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base46[32]     = {0x82,0xce,0x78,0x6f,0x6f,0xad,0x79,0x36,0x44,0x06,0xc0,0x53,0xf8,0x95,0xfc,0x55,0x3f,0xd3,0xbe,0x98,0x26,0x1f,0x40,0xdf,0xef,0x82,0xd1,0xa3,0xa2,0x8c,0xf7,0xb1};
    std::uint8_t exponent46[32] = {0xe2,0x5f,0x4b,0x1c,0x6d,0x80,0xde,0x7c,0xf4,0xc7,0x3f,0x2b,0xc8,0xff,0x1c,0x38,0x5f,0x93,0xd1,0x80,0xc5,0xef,0x5c,0xfb,0x30,0x99,0xf2,0x71,0x50,0xcb,0x40,0x7a};
    std::uint8_t power46[32]    = {0xd3,0xf1,0x58,0xa8,0xfa,0x2e,0x53,0x59,0xf3,0x4a,0xc6,0x77,0xc1,0xdb,0xe7,0x02,0x88,0x61,0xf4,0xda,0xb5,0xaa,0x75,0xa8,0xd8,0xe7,0x9b,0x9d,0xbf,0x17,0x1d,0xd2};
    mont256_from_bytes(&ctx, base, base46);
    uint256_from_bytes(exponent, exponent46);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power46, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base47[32]     = {0x8d,0xdc,0xf8,0x3c,0xf0,0xd1,0xab,0x56,0xe0,0x2f,0x9a,0x72,0xe9,0xd6,0x25,0xc9,0x66,0x69,0x21,0x58,0xa1,0x82,0x63,0x27,0xc2,0xfb,0xd8,0xa3,0xcf,0xdc,0xc2,0x57};
    std::uint8_t exponent47[32] = {0x69,0x2f,0xd3,0x60,0xbb,0x7b,0x73,0x8e,0xee,0xf7,0x95,0xcd,0x0c,0xaa,0x76,0x12,0x14,0xa0,0xb0,0x0b,0xb8,0x35,0xe8,0xa5,0x34,0x14,0x5e,0x87,0x8c,0x9a,0x37,0x51};
    std::uint8_t power47[32]    = {0x02,0x1a,0x6d,0x41,0x43,0x50,0x46,0xa8,0x5a,0xe2,0x21,0xba,0xd7,0xcc,0x0f,0x97,0x2d,0x61,0xe8,0xda,0xfd,0xeb,0x7a,0x62,0x0a,0xca,0xec,0xe3,0xab,0x30,0x24,0x26};
    mont256_from_bytes(&ctx, base, base47);
    uint256_from_bytes(exponent, exponent47);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power47, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base48[32]     = {0x0c,0x89,0xc0,0x01,0x7c,0x4e,0xa6,0x03,0x49,0x44,0xf2,0xce,0xde,0x96,0x2a,0x6d,0xa4,0xfd,0x57,0xc5,0x23,0x79,0x7d,0x45,0xc0,0xae,0xd9,0xc5,0x9d,0x6b,0x02,0x3f};
    std::uint8_t exponent48[32] = {0x57,0xfa,0x49,0xe5,0x6a,0x34,0xb3,0x71,0x78,0xe1,0x0e,0x70,0x2b,0xb7,0x1c,0x68,0x20,0x97,0x79,0x8c,0x8c,0xd3,0xe4,0x18,0xed,0x41,0x42,0xba,0xe9,0x72,0x9f,0x3f};
    std::uint8_t power48[32]    = {0x67,0x7f,0x31,0x9c,0x79,0x26,0x02,0x40,0xfd,0x96,0x76,0xe3,0x4f,0x6b,0x75,0x2d,0x15,0x2e,0x71,0xda,0x9e,0xf4,0xba,0x41,0x3a,0x3e,0xfb,0x6b,0x0c,0x52,0x47,0xd9};
    mont256_from_bytes(&ctx, base, base48);
    uint256_from_bytes(exponent, exponent48);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power48, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base49[32]     = {0x67,0xfd,0x54,0x99,0x42,0x9a,0x70,0x79,0xa7,0x1f,0x11,0xb2,0xf9,0xee,0x8b,0xc8,0xbd,0x1e,0x69,0x12,0xbd,0x31,0x3b,0xee,0x41,0x78,0x5b,0xc6,0x4c,0x3a,0xc6,0xfc};
    std::uint8_t exponent49[32] = {0x1e,0xa7,0x72,0x28,0x64,0xf5,0x49,0x69,0xab,0x3b,0x74,0xfe,0x8e,0xac,0xa2,0x88,0x7b,0xb1,0xd1,0x24,0x4d,0x03,0x9b,0x72,0x3d,0x19,0x26,0xac,0xa7,0xef,0x4f,0x5d};
    std::uint8_t power49[32]    = {0xae,0xf1,0x69,0x5a,0xee,0x41,0x05,0x36,0x3f,0xe4,0x3c,0xf7,0xc8,0x2a,0x31,0xe5,0x38,0x76,0x33,0x1d,0xaf,0xde,0x94,0x90,0x51,0x6e,0xe7,0xdb,0x1d,0x4b,0x5c,0xfb};
    mont256_from_bytes(&ctx, base, base49);
    uint256_from_bytes(exponent, exponent49);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power49, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base50[32]     = {0x7f,0x40,0x5b,0xc8,0xcf,0xd3,0xdd,0x72,0xe7,0xec,0xfd,0x0c,0x80,0x27,0xa2,0xa2,0x35,0x37,0x22,0x35,0x13,0x3e,0x61,0x53,0x29,0x62,0x59,0xc8,0xa4,0xa9,0x15,0xd0};
    std::uint8_t exponent50[32] = {0x73,0x30,0x9b,0x95,0xc2,0x5e,0x11,0x4f,0xff,0x18,0xfe,0x33,0x55,0x34,0xa0,0x34,0xe8,0x00,0x9d,0x90,0x73,0xf6,0xe5,0x3d,0x38,0x53,0x93,0x3d,0x8c,0xe6,0x21,0xef};
    std::uint8_t power50[32]    = {0x9a,0x01,0x63,0x22,0x17,0x6c,0x90,0x6c,0xdc,0xf5,0x1b,0xd6,0xad,0x78,0x45,0x54,0x8b,0xe8,0x0c,0xf1,0x04,0xeb,0xc9,0x33,0x2b,0xba,0x85,0x00,0x93,0xe5,0xc4,0x54};
    mont256_from_bytes(&ctx, base, base50);
    uint256_from_bytes(exponent, exponent50);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power50, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base51[32]     = {0x8e,0x4d,0xc3,0xa3,0x57,0x8a,0x60,0xd8,0x2c,0xb8,0xd1,0x4c,0x17,0x39,0x10,0xe3,0x3e,0x7c,0x65,0x67,0x31,0x41,0x97,0x75,0x8c,0x3b,0xa8,0x59,0x23,0xbc,0x91,0x52};
    std::uint8_t exponent51[32] = {0x86,0x2f,0xe2,0x31,0xbe,0xef,0x67,0xfb,0x69,0xf4,0x46,0x12,0x62,0x01,0xa9,0xd3,0x69,0xac,0x0f,0x03,0xde,0xe0,0xa8,0x43,0xbf,0xe9,0x8f,0x8c,0x05,0x24,0x13,0x7f};
    std::uint8_t power51[32]    = {0x09,0xd1,0x02,0xc8,0xc1,0xdc,0xce,0xb5,0xa3,0xfa,0xed,0xae,0xea,0x9e,0xf7,0xbf,0x01,0x5d,0xdb,0x61,0x94,0x9b,0x62,0x0f,0x1b,0x14,0xef,0xdd,0xa8,0x16,0x79,0x3b};
    mont256_from_bytes(&ctx, base, base51);
    uint256_from_bytes(exponent, exponent51);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power51, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base52[32]     = {0x93,0x04,0x10,0x6e,0x47,0x0b,0x4f,0xad,0x7f,0x86,0x7d,0x5f,0x0f,0xe3,0x21,0xec,0xc0,0x8a,0x58,0xd7,0x56,0x94,0x7a,0x7a,0x45,0x2e,0x70,0x4d,0x60,0x7a,0x47,0x32};
    std::uint8_t exponent52[32] = {0xf7,0xd1,0x7e,0xbd,0xdf,0x75,0xc8,0x83,0xd0,0x78,0x84,0xb7,0xd9,0x43,0x55,0x41,0x4f,0xe0,0x48,0x02,0xf4,0x35,0xa5,0x73,0x6e,0x8c,0xd9,0x4e,0x72,0x23,0xc6,0x8a};
    std::uint8_t power52[32]    = {0x11,0x3c,0xba,0x47,0x66,0xb5,0x42,0xb7,0x53,0x33,0xb6,0x47,0xf3,0xbc,0x3d,0x2f,0xf6,0xbb,0x9f,0xaf,0x97,0xe4,0x27,0xda,0x71,0x76,0x74,0x98,0xf7,0x0b,0xef,0x17};
    mont256_from_bytes(&ctx, base, base52);
    uint256_from_bytes(exponent, exponent52);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power52, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base53[32]     = {0x79,0x28,0x1c,0x19,0xcd,0xe3,0x47,0xab,0xe5,0x4c,0x5d,0xe6,0xc3,0x81,0x3c,0xe6,0xb5,0xa2,0x90,0x61,0x6c,0xd9,0xe6,0x2a,0x08,0x41,0x1c,0x07,0x20,0x93,0x42,0xca};
    std::uint8_t exponent53[32] = {0xc8,0x79,0xb6,0x63,0x3f,0x9b,0x6b,0xb2,0x72,0xee,0x6a,0x2e,0xf8,0xe4,0xcb,0x5c,0x77,0xd8,0xc5,0x69,0xda,0xff,0x9a,0x0b,0x87,0x21,0xec,0xf8,0xd3,0x59,0xd0,0x7a};
    std::uint8_t power53[32]    = {0xb9,0x92,0xc1,0x80,0x3f,0x16,0x1b,0xff,0xd1,0x7a,0x7a,0x5f,0x75,0xd7,0x25,0x8a,0x7d,0x9e,0x17,0x25,0x16,0x02,0x9d,0xc1,0xfd,0x6c,0xf0,0xa4,0xd3,0xaa,0x9e,0x7e};
    mont256_from_bytes(&ctx, base, base53);
    uint256_from_bytes(exponent, exponent53);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power53, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base54[32]     = {0xf1,0x05,0x86,0x67,0x1b,0xe0,0x3d,0xf0,0xae,0x9c,0x78,0xbd,0xf8,0xcd,0x9e,0xc3,0x85,0xb9,0xc0,0x9a,0x26,0xed,0xf1,0xbd,0x27,0x85,0x57,0x98,0x39,0x4a,0xfb,0xe9};
    std::uint8_t exponent54[32] = {0x75,0x13,0x41,0x07,0xe5,0x17,0x4e,0xbd,0xc3,0xc9,0xf7,0xe3,0xd8,0xb4,0xc8,0x31,0xa5,0xb8,0x9b,0x2f,0xb3,0x74,0xfa,0xb6,0xb8,0xc3,0xa4,0xd2,0xd3,0x4d,0x1c,0x0d};
    std::uint8_t power54[32]    = {0xbf,0x47,0xb1,0xbb,0x6d,0x6d,0x88,0x7a,0x05,0x85,0xb0,0x53,0x90,0xdc,0x5d,0x68,0x8c,0x5d,0xd5,0x97,0xa5,0x96,0xb9,0x5c,0x64,0x44,0xfc,0xce,0x66,0x92,0x1f,0x23};
    mont256_from_bytes(&ctx, base, base54);
    uint256_from_bytes(exponent, exponent54);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power54, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base55[32]     = {0x91,0xc3,0x09,0x8c,0x3b,0x8a,0x27,0xba,0x20,0x2a,0xb6,0xfa,0xc8,0x44,0xb8,0xfd,0x00,0x59,0x86,0x5a,0x0a,0x1f,0xb4,0x3b,0xc6,0xe0,0x67,0x3a,0x8d,0x2f,0x29,0xe7};
    std::uint8_t exponent55[32] = {0xa0,0x60,0x84,0x6c,0x20,0xc2,0x6f,0x71,0xf6,0x62,0x22,0x2e,0x4d,0xc4,0xac,0x8c,0xb7,0x0b,0xa8,0x58,0xa5,0x3f,0xdd,0xc9,0x09,0x9f,0x9c,0x9f,0xeb,0x7f,0xe2,0x6b};
    std::uint8_t power55[32]    = {0x90,0x0d,0x30,0xb8,0x38,0xed,0xab,0xa2,0x6f,0xc8,0x5d,0x05,0xa5,0x4e,0x3b,0x90,0x97,0x79,0x95,0x48,0xa8,0xcb,0x3f,0x7d,0xfd,0x18,0x4b,0xe9,0xde,0xea,0xaa,0x09};
    mont256_from_bytes(&ctx, base, base55);
    uint256_from_bytes(exponent, exponent55);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power55, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base56[32]     = {0x12,0x02,0x95,0x2f,0x19,0x75,0x36,0xb1,0x1c,0xb4,0xba,0x55,0xc3,0x8b,0x48,0xa2,0xb2,0xd6,0x43,0xa2,0x6f,0xfb,0x72,0x6a,0xa2,0xe3,0xf9,0x3a,0x87,0x3b,0x99,0x03};
    std::uint8_t exponent56[32] = {0x0e,0x28,0xb6,0x4f,0x4e,0xb1,0x9f,0xca,0xa6,0x4f,0x76,0x13,0xb4,0x64,0x2e,0xa4,0x69,0x6c,0x63,0xd6,0xf5,0xea,0xd0,0x65,0x07,0x7e,0xf3,0x2a,0x3f,0x3f,0x37,0xea};
    std::uint8_t power56[32]    = {0xe8,0x85,0xd5,0x2d,0xfc,0x32,0xa6,0x22,0x98,0x86,0xa3,0x09,0xa5,0x95,0x80,0x93,0x1b,0xe8,0x27,0x8f,0x04,0x79,0x19,0x3a,0xde,0x46,0xfe,0x8e,0x27,0x7e,0x5a,0xfe};
    mont256_from_bytes(&ctx, base, base56);
    uint256_from_bytes(exponent, exponent56);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power56, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base57[32]     = {0x41,0xdb,0x89,0x8e,0x14,0xc2,0x73,0x2a,0x6b,0x86,0x29,0x0b,0xa5,0xac,0xd3,0x41,0xac,0xa9,0x9f,0xd0,0xe2,0x85,0x6e,0xc6,0x7f,0x91,0x42,0x86,0x31,0xb1,0x89,0x1a};
    std::uint8_t exponent57[32] = {0xf8,0x48,0xa9,0x56,0x7e,0xe5,0xe8,0x57,0x34,0x89,0x34,0x98,0x11,0x43,0x40,0xff,0x81,0x3f,0xb5,0xcd,0xd8,0x5b,0xbb,0x6b,0xbd,0x37,0x92,0x9d,0x4a,0xc7,0xcc,0xc3};
    std::uint8_t power57[32]    = {0x44,0xa1,0x20,0x04,0x9d,0x14,0xfc,0xc9,0xa8,0x47,0x87,0xa8,0xa4,0x88,0x9d,0x77,0xec,0xa3,0x0e,0x9f,0xa0,0x1b,0x20,0xea,0x54,0x52,0x4e,0x9c,0xb3,0x2c,0xf4,0x14};
    mont256_from_bytes(&ctx, base, base57);
    uint256_from_bytes(exponent, exponent57);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power57, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base58[32]     = {0x43,0xd8,0x7a,0x97,0x38,0xb0,0x79,0xe1,0x77,0x11,0xb7,0x57,0x3b,0x16,0x49,0x43,0x31,0xa5,0x9c,0x4a,0xd1,0xeb,0xd0,0x86,0xc4,0x0f,0x36,0x09,0x4f,0xcc,0x9a,0x5c};
    std::uint8_t exponent58[32] = {0x9c,0x2f,0x67,0x23,0x7e,0xea,0x6f,0xe1,0x9f,0xa4,0x0d,0xd6,0xf3,0xb1,0x7a,0xf0,0x1b,0xe7,0xf3,0xcf,0x4b,0x80,0xb8,0x28,0xe3,0xab,0x62,0x83,0xc2,0xae,0x35,0xd2};
    std::uint8_t power58[32]    = {0x4e,0x98,0x85,0x8d,0xd9,0xa5,0xed,0x67,0xd0,0x7b,0xdf,0x37,0x6f,0x19,0x9e,0x54,0x9e,0x42,0x8c,0xea,0xa2,0x55,0x31,0x5a,0xe0,0x9a,0x4d,0x13,0x94,0x38,0x91,0xfc};
    mont256_from_bytes(&ctx, base, base58);
    uint256_from_bytes(exponent, exponent58);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power58, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base59[32]     = {0xf2,0xe2,0x05,0x4d,0x0e,0x71,0x59,0x7a,0xaa,0x50,0xb9,0x6f,0xe9,0x0f,0xb6,0x51,0x6a,0xc2,0x6a,0xe0,0x7c,0x2c,0x6a,0x87,0x39,0x2b,0xc5,0x52,0xe5,0x7f,0x76,0x91};
    std::uint8_t exponent59[32] = {0xee,0x7d,0x0a,0xe2,0x14,0x51,0x03,0xc7,0xff,0x5e,0x1d,0x1f,0x1c,0xfb,0x0a,0x06,0xbb,0x93,0xc8,0xeb,0x50,0x6f,0x68,0xac,0xe2,0x32,0x89,0x94,0xb6,0x47,0xe8,0xa8};
    std::uint8_t power59[32]    = {0xc2,0x6e,0x65,0x51,0x3c,0xf0,0xbb,0xaf,0x1d,0x0e,0x0d,0x97,0x76,0x92,0xe9,0xb9,0xb4,0xbe,0x94,0x78,0xc5,0xc7,0x1e,0x81,0x5d,0xf8,0xa4,0xda,0xae,0xdd,0xf7,0xd8};
    mont256_from_bytes(&ctx, base, base59);
    uint256_from_bytes(exponent, exponent59);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power59, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base60[32]     = {0x77,0xb5,0xab,0xcb,0xbf,0x0e,0x11,0xe0,0x86,0x59,0x22,0x43,0xef,0x95,0xee,0xe8,0xa7,0x08,0x28,0xa7,0x2f,0x7d,0xba,0x08,0x30,0xd0,0xa2,0xb8,0x54,0x49,0x40,0xe1};
    std::uint8_t exponent60[32] = {0xfc,0x27,0xd6,0x83,0x5f,0xb6,0xd6,0x25,0xd6,0xd1,0x06,0xfb,0x60,0xed,0x33,0xa0,0xb9,0xb2,0x53,0xe3,0xaa,0x18,0x13,0x45,0x4f,0xd3,0xe7,0x58,0x08,0x2a,0x2f,0x4d};
    std::uint8_t power60[32]    = {0xa3,0xe7,0xb5,0x75,0x74,0x7c,0xc2,0x7d,0x10,0x69,0x4f,0xec,0x3a,0xb2,0xe6,0xcb,0xc9,0xeb,0x97,0xfc,0x7b,0x23,0x1d,0xbe,0xa2,0x55,0x20,0xaf,0x41,0x66,0x32,0xdc};
    mont256_from_bytes(&ctx, base, base60);
    uint256_from_bytes(exponent, exponent60);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power60, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base61[32]     = {0x59,0xf9,0xbb,0x79,0x14,0xac,0xe1,0xcb,0x47,0xa1,0x64,0xe4,0x14,0x07,0xab,0x33,0x00,0xbc,0x22,0xcb,0x1b,0xe4,0xa5,0xdb,0x2b,0x54,0xaf,0x77,0x71,0x43,0x6e,0x1d};
    std::uint8_t exponent61[32] = {0x35,0x18,0x53,0x76,0xc2,0x41,0x0a,0xd1,0xf6,0xda,0x7a,0x63,0x8f,0xa6,0x24,0xf7,0x1f,0xab,0x58,0x84,0xe2,0x9a,0xac,0xea,0xf4,0x9c,0x9e,0xba,0x6b,0x91,0x1f,0x97};
    std::uint8_t power61[32]    = {0x1d,0x64,0x02,0x3d,0xfa,0x1e,0xf0,0x57,0x59,0x6f,0x5b,0x68,0x91,0x89,0x5c,0x16,0x4b,0xe5,0xf5,0xba,0x2b,0xb1,0x22,0x62,0xfc,0xc6,0xd3,0xf3,0xf1,0x1f,0xea,0x81};
    mont256_from_bytes(&ctx, base, base61);
    uint256_from_bytes(exponent, exponent61);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power61, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base62[32]     = {0x16,0x77,0x74,0xef,0x6e,0xb4,0xff,0xf8,0xcd,0xce,0xc4,0x08,0xd2,0x6f,0x1d,0x76,0x4f,0x06,0xe9,0x5a,0xd2,0x52,0xa6,0x17,0xc4,0xcb,0xa0,0x38,0x5b,0x4c,0x0d,0x73};
    std::uint8_t exponent62[32] = {0x72,0x43,0xd4,0x7c,0xeb,0x64,0xc5,0xc4,0x8a,0xa1,0xa5,0x9c,0x5f,0x6a,0x35,0xd9,0x32,0x1a,0x6e,0xc1,0x79,0x34,0xf0,0xb8,0xb4,0x8b,0xb0,0x75,0x0c,0x9c,0x20,0xef};
    std::uint8_t power62[32]    = {0x3d,0xee,0x46,0xfb,0xb7,0x54,0x4d,0xad,0xbb,0x0e,0xf1,0x6b,0xb5,0xb7,0x2b,0xfe,0xbc,0x2e,0xd2,0xae,0x4d,0x87,0x27,0x18,0xd1,0x7e,0x4c,0xb8,0x05,0x2b,0xaf,0x9d};
    mont256_from_bytes(&ctx, base, base62);
    uint256_from_bytes(exponent, exponent62);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power62, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base63[32]     = {0x69,0x2a,0x4f,0x0e,0xa1,0xb4,0x9b,0xf7,0x07,0xc0,0x90,0x9c,0x79,0x7b,0x15,0x38,0xe5,0xa1,0x5b,0x79,0xbc,0xc0,0xfd,0x98,0x5d,0x3f,0x69,0xce,0x52,0xc4,0x64,0x1b};
    std::uint8_t exponent63[32] = {0x08,0xec,0x37,0x9a,0x60,0x25,0x33,0xdc,0x0a,0x68,0x01,0x3d,0x67,0x9f,0x2d,0x9e,0xc4,0x44,0x5a,0xae,0xa0,0x1a,0xc2,0x3a,0xcf,0xd3,0xbb,0x74,0x3f,0x7d,0xc8,0x6b};
    std::uint8_t power63[32]    = {0x78,0x6b,0x23,0xd4,0x3e,0x72,0x38,0x93,0xde,0xe3,0x55,0x53,0x64,0x2f,0x21,0xbd,0x0c,0xa8,0x05,0x52,0x74,0x8c,0xff,0x1b,0xc5,0xa5,0xa4,0x23,0x60,0xd1,0xb8,0x4e};
    mont256_from_bytes(&ctx, base, base63);
    uint256_from_bytes(exponent, exponent63);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power63, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base64[32]     = {0x10,0x17,0x0d,0x2b,0xbf,0x4e,0x30,0x2c,0x31,0xe7,0xae,0xd1,0x41,0xcb,0xcc,0x3a,0x0f,0xdf,0x7c,0xc6,0xeb,0x8a,0x25,0xfc,0xcd,0xa7,0x90,0x77,0x10,0x05,0x3d,0x2c};
    std::uint8_t exponent64[32] = {0x46,0x8f,0xb5,0x96,0xec,0x9a,0x36,0x0c,0x51,0x05,0x12,0x2a,0xb0,0x88,0x24,0x11,0xb7,0x75,0x70,0xa4,0xbf,0x16,0x8d,0xa7,0x43,0x1d,0xbc,0x3f,0x0b,0x28,0x6c,0x70};
    std::uint8_t power64[32]    = {0x85,0x1c,0xd1,0x66,0x11,0x78,0xd9,0x5e,0x09,0x8c,0xbb,0x66,0x90,0xe5,0x1b,0xf1,0x0c,0x01,0x7a,0xb6,0x66,0x88,0xb2,0x2a,0xc3,0x6e,0x1e,0x34,0x5f,0x38,0x9f,0xc5};
    mont256_from_bytes(&ctx, base, base64);
    uint256_from_bytes(exponent, exponent64);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power64, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base65[32]     = {0xf2,0x4d,0x04,0xfd,0xa2,0x4c,0x84,0x07,0xce,0x3f,0xa0,0x28,0xea,0x9d,0x18,0xb2,0x98,0x77,0x27,0x90,0xc1,0x72,0x6f,0x06,0xb8,0xb8,0xf2,0x70,0x00,0xf7,0x2d,0x3c};
    std::uint8_t exponent65[32] = {0x83,0x0a,0xe1,0x9e,0x14,0x3a,0x51,0x80,0x98,0x80,0xe8,0x8b,0xc8,0x41,0x72,0x1e,0xc8,0xa9,0x48,0x14,0x5c,0xa2,0xc1,0x32,0x75,0xf5,0xc1,0xa0,0x51,0xcd,0xf2,0xf9};
    std::uint8_t power65[32]    = {0xac,0x0d,0x84,0x3c,0x90,0xcf,0xfd,0xfc,0xb6,0xb7,0x84,0x70,0x6d,0x31,0x4f,0x3d,0x04,0x9a,0xc0,0x45,0xbb,0x0a,0x9a,0x00,0x0c,0xef,0x84,0x8d,0x59,0xee,0x16,0xe4};
    mont256_from_bytes(&ctx, base, base65);
    uint256_from_bytes(exponent, exponent65);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power65, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base66[32]     = {0x08,0xab,0x4a,0xe4,0xa6,0x48,0xa5,0x8c,0x10,0x92,0x57,0xf7,0x68,0x62,0xbf,0x79,0x3f,0x4f,0x8b,0x9d,0x28,0xf1,0xa8,0x1b,0xc0,0xbd,0x1d,0x84,0x64,0x45,0x7e,0xa4};
    std::uint8_t exponent66[32] = {0xe2,0x2b,0x64,0xa6,0x6d,0x32,0xa9,0x01,0xfa,0xf2,0x0a,0xc0,0x29,0x23,0x22,0xd3,0x53,0x64,0xe6,0x4d,0x8b,0x6b,0xfe,0xae,0x8d,0x76,0xd7,0xa1,0x7b,0x50,0x07,0x9e};
    std::uint8_t power66[32]    = {0x09,0x9f,0x3f,0x0f,0x32,0x52,0x63,0xab,0xcc,0x04,0x14,0x4d,0x74,0x58,0x8a,0xb2,0xe2,0xd9,0x75,0x38,0xbb,0x5d,0xeb,0x18,0x19,0x55,0xbe,0x70,0x67,0x09,0xe1,0xd8};
    mont256_from_bytes(&ctx, base, base66);
    uint256_from_bytes(exponent, exponent66);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power66, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base67[32]     = {0x6b,0xca,0x9b,0x3f,0x18,0xaf,0x26,0x6c,0x35,0x55,0xd6,0xae,0x15,0x86,0x6f,0xfb,0x9f,0xe5,0xe3,0x99,0x43,0xcf,0xea,0xdf,0x12,0x79,0x68,0x8c,0xfc,0xe2,0x05,0xcd};
    std::uint8_t exponent67[32] = {0x22,0x07,0xc6,0xc0,0x3b,0xf4,0x49,0xfd,0x2c,0x56,0x4d,0x56,0x72,0x6c,0x2c,0x95,0xf8,0xdc,0xa3,0x09,0xb5,0xb3,0x90,0x23,0xfd,0x09,0xe3,0x7c,0x7f,0x9c,0x13,0x21};
    std::uint8_t power67[32]    = {0x59,0x7c,0x7d,0x32,0x5c,0x10,0x0e,0x79,0x18,0x5a,0x8b,0xd1,0x9f,0xfc,0xf9,0x28,0x2c,0x5f,0xec,0x8c,0x03,0xe3,0xd9,0xfa,0xae,0x32,0x83,0xe0,0x5e,0x84,0x1b,0x70};
    mont256_from_bytes(&ctx, base, base67);
    uint256_from_bytes(exponent, exponent67);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power67, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base68[32]     = {0xd8,0xd4,0x25,0x0d,0x89,0xdf,0x5e,0x79,0xbf,0x7b,0x6c,0x6c,0x3c,0x24,0x96,0xeb,0xac,0x92,0x61,0xf1,0xe4,0x29,0xc8,0x7c,0x9e,0xcc,0x7b,0x5f,0x75,0xff,0x19,0x9d};
    std::uint8_t exponent68[32] = {0x4b,0x35,0x4e,0x93,0x4b,0x3e,0x90,0xb7,0xd7,0x43,0x55,0x71,0xc7,0x9d,0xbc,0x12,0x1f,0x04,0xa6,0xff,0xc2,0x72,0xf5,0xa7,0xaa,0x17,0xc5,0x7c,0xc6,0x1c,0x96,0xdb};
    std::uint8_t power68[32]    = {0x4d,0xbb,0x34,0x47,0xc2,0xe6,0x3f,0xb4,0x9a,0x59,0x59,0x90,0xc3,0xf9,0x44,0x87,0xa4,0x6d,0x85,0xfb,0xb7,0x9b,0x69,0xd6,0xcf,0x92,0x58,0xa8,0x87,0x6a,0x71,0xa6};
    mont256_from_bytes(&ctx, base, base68);
    uint256_from_bytes(exponent, exponent68);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power68, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base69[32]     = {0x70,0x7c,0x5f,0x3d,0x32,0xfe,0x1f,0x36,0x42,0xa5,0x51,0x62,0xbc,0xf1,0xfc,0xb5,0x41,0x09,0xd8,0xd6,0x5f,0x7b,0x07,0xb8,0x44,0x85,0xc0,0x4f,0x91,0x1f,0x52,0xdc};
    std::uint8_t exponent69[32] = {0x09,0x7a,0x59,0x42,0xfd,0xaf,0x45,0x13,0x76,0xc3,0x2d,0xcd,0xa7,0x40,0x68,0xb2,0x19,0xbd,0x26,0x40,0xce,0xf6,0x1d,0x03,0xa6,0x4e,0xd9,0x96,0x3b,0x3b,0xc8,0x13};
    std::uint8_t power69[32]    = {0x76,0xcf,0x3a,0xcc,0xd0,0x4a,0x84,0xea,0x2c,0xce,0xd1,0xc2,0xfb,0xd5,0x64,0xdf,0xb5,0x31,0x07,0xb6,0xce,0x18,0x44,0x07,0x84,0x3b,0x5d,0x61,0xe7,0x9b,0xa6,0xdd};
    mont256_from_bytes(&ctx, base, base69);
    uint256_from_bytes(exponent, exponent69);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power69, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base70[32]     = {0xea,0x14,0x84,0x3a,0x72,0xc3,0x9a,0x28,0xd7,0x2e,0xb3,0xa1,0x3b,0x2a,0x42,0x1a,0xd1,0xb0,0xb7,0x0b,0xe2,0x00,0xd2,0x18,0x79,0x8a,0x0d,0x59,0x01,0x26,0x64,0xf6};
    std::uint8_t exponent70[32] = {0xf2,0x19,0x88,0x25,0xaa,0x2d,0x6c,0x38,0xc7,0x1c,0x58,0x8c,0xc6,0x66,0x48,0x43,0x42,0x8b,0xf7,0x73,0x9a,0x60,0xf9,0x19,0x72,0xf9,0x20,0x26,0x2d,0x81,0x9d,0x38};
    std::uint8_t power70[32]    = {0xb4,0x04,0x12,0x19,0xa2,0x44,0xed,0xa2,0x9a,0xef,0x4d,0xb3,0xed,0x28,0x86,0x3c,0xae,0x23,0x25,0x80,0x20,0x53,0x4f,0x10,0xf1,0x5e,0x18,0xc5,0xb1,0xbe,0x38,0xaf};
    mont256_from_bytes(&ctx, base, base70);
    uint256_from_bytes(exponent, exponent70);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power70, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base71[32]     = {0x09,0x96,0x9e,0x7c,0x37,0xb7,0x9c,0x48,0x59,0x85,0xea,0x3f,0x9e,0xb4,0xe9,0x2e,0xb5,0xaf,0x4c,0x8a,0x98,0x9d,0x18,0x1c,0xa3,0x30,0x66,0xbd,0x1b,0x14,0x66,0xf6};
    std::uint8_t exponent71[32] = {0x53,0xc6,0x9b,0x0a,0xd1,0x9f,0x0b,0xe9,0x02,0xe9,0xc9,0xfb,0xd0,0x93,0x0b,0x64,0x34,0x14,0xc2,0xdc,0xe9,0xf8,0xf7,0x1f,0xa6,0xd2,0x10,0x40,0xbb,0x73,0x52,0xc1};
    std::uint8_t power71[32]    = {0x16,0x72,0x80,0x29,0x08,0x1e,0x68,0x80,0x07,0xee,0xb1,0x8d,0x73,0x9a,0x65,0xde,0xaf,0xe6,0x81,0x37,0x20,0x16,0x3d,0xac,0x4d,0xbf,0x3e,0x57,0xd9,0xac,0x5f,0x46};
    mont256_from_bytes(&ctx, base, base71);
    uint256_from_bytes(exponent, exponent71);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power71, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base72[32]     = {0x08,0x0e,0x31,0xb0,0x34,0x12,0x88,0x22,0x13,0xf3,0x88,0x70,0x4f,0xec,0x0f,0x40,0x9e,0xfa,0xc2,0x92,0x2f,0x65,0xab,0x4e,0x5f,0x2e,0xe4,0x0d,0xad,0xa6,0x5c,0xc4};
    std::uint8_t exponent72[32] = {0xcb,0xbc,0x6c,0x94,0x19,0xf4,0x8c,0x75,0x68,0x7d,0xd5,0x12,0x10,0x32,0x88,0x8d,0x7b,0xc7,0x1d,0xf3,0x8c,0x4c,0xaa,0x83,0x7e,0xe1,0x4b,0x90,0xcb,0x97,0x8b,0xe3};
    std::uint8_t power72[32]    = {0xdd,0xdb,0x2e,0x19,0xeb,0x7f,0xcd,0x9a,0x20,0x51,0x53,0x6d,0x06,0xbb,0xfb,0xc9,0xbc,0xbe,0x2e,0x9e,0x17,0x15,0x3d,0x8a,0xd0,0x5f,0xdb,0xef,0x8e,0xe1,0x76,0x82};
    mont256_from_bytes(&ctx, base, base72);
    uint256_from_bytes(exponent, exponent72);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power72, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base73[32]     = {0x29,0xe7,0x8b,0x06,0xa7,0x2e,0xd5,0x08,0x17,0x55,0xc6,0xde,0x88,0xb4,0x09,0xc8,0xa3,0xa1,0x6d,0x92,0x27,0x90,0xbb,0x01,0x8c,0xd5,0xd1,0x87,0xa9,0xfd,0xa2,0xef};
    std::uint8_t exponent73[32] = {0x4e,0xbe,0x98,0x80,0xaa,0xf5,0xa8,0x6e,0x48,0x86,0x6d,0x48,0xfc,0xfd,0x36,0xd1,0x68,0xe7,0xed,0x23,0x45,0x6b,0x31,0x2c,0xb2,0x06,0x1e,0xcc,0x65,0xd4,0x64,0xfd};
    std::uint8_t power73[32]    = {0xfc,0x35,0xc6,0x85,0x8d,0x97,0x0d,0xff,0xd2,0xfb,0x0d,0x49,0x5f,0xbd,0xe3,0xee,0xab,0xea,0x62,0x15,0x88,0x60,0xbb,0x3d,0x3e,0xc4,0x36,0x59,0x16,0xdf,0x22,0xaf};
    mont256_from_bytes(&ctx, base, base73);
    uint256_from_bytes(exponent, exponent73);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power73, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base74[32]     = {0x6a,0x01,0x26,0x0f,0x5b,0x70,0x42,0xdf,0xe2,0x39,0xd3,0xd7,0x91,0x07,0x75,0x6f,0xbe,0xce,0x71,0x45,0x4f,0xf6,0xf2,0xc5,0x0d,0x25,0xf9,0x54,0xf4,0x04,0x2f,0x1e};
    std::uint8_t exponent74[32] = {0xa4,0xfc,0x86,0x21,0x5d,0x20,0xc6,0xa6,0xcd,0x5e,0x4a,0xa0,0xff,0x22,0x82,0xe6,0xc4,0x44,0x00,0x54,0xdd,0x3f,0x40,0x06,0x04,0xa9,0x9e,0x63,0x6a,0x9c,0x2a,0x33};
    std::uint8_t power74[32]    = {0x67,0x3e,0x33,0x2c,0xc2,0x5a,0xee,0xe3,0x60,0xd0,0x70,0x4d,0x80,0x22,0x02,0x8e,0xa5,0x98,0x98,0xe2,0x29,0xef,0x2f,0x33,0x29,0x1c,0xb3,0x26,0x0e,0x1d,0xce,0xaf};
    mont256_from_bytes(&ctx, base, base74);
    uint256_from_bytes(exponent, exponent74);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power74, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base75[32]     = {0xe6,0xd1,0x43,0x18,0x6f,0x25,0x63,0x0d,0x01,0x81,0x20,0xf8,0xf1,0x26,0x16,0x42,0x34,0x23,0x88,0x0b,0x67,0xac,0x56,0xf8,0xba,0x60,0x49,0x1e,0x64,0x06,0xf4,0x58};
    std::uint8_t exponent75[32] = {0xe2,0x01,0xaa,0xfd,0x93,0xea,0x6a,0x94,0x67,0xfd,0xe1,0xc3,0x17,0x2a,0x39,0x0a,0xd2,0x03,0xac,0xfe,0x1d,0x10,0xe9,0x31,0x6c,0x7b,0x31,0xe2,0x28,0x14,0xc4,0x37};
    std::uint8_t power75[32]    = {0x6e,0xc7,0xcc,0x50,0xf0,0x1b,0x5e,0x80,0x5f,0xdd,0x74,0x07,0x74,0xc4,0x8a,0x39,0x05,0xac,0x14,0x86,0xc5,0xfa,0x77,0x29,0x61,0x70,0xc2,0x13,0xb7,0x39,0x66,0xde};
    mont256_from_bytes(&ctx, base, base75);
    uint256_from_bytes(exponent, exponent75);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power75, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base76[32]     = {0x24,0x7a,0xab,0xb5,0x8d,0x32,0x3d,0x9e,0x0d,0x3b,0xe8,0xee,0x03,0xcc,0x2f,0x9b,0x21,0x46,0x0c,0x5a,0x29,0x9c,0x85,0x8d,0xc5,0xe6,0xe6,0x2f,0x75,0xfd,0xf3,0x7c};
    std::uint8_t exponent76[32] = {0xed,0x5e,0xc9,0x04,0x9f,0x48,0x25,0x0d,0x92,0xa7,0x3f,0x9d,0x16,0xca,0xbe,0x32,0x65,0x8f,0x62,0xd1,0xe8,0xe8,0x4b,0x0d,0xce,0x74,0xb3,0xc4,0xa4,0x02,0xbb,0x72};
    std::uint8_t power76[32]    = {0xbd,0xf4,0xc5,0xdf,0x85,0xe9,0x35,0x1e,0xe2,0x98,0xf5,0xac,0xae,0x3b,0xe4,0x84,0x41,0x6d,0xfb,0x75,0x75,0x36,0xc4,0xf9,0x31,0x7a,0x24,0x73,0xfa,0xc4,0xe0,0xe1};
    mont256_from_bytes(&ctx, base, base76);
    uint256_from_bytes(exponent, exponent76);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power76, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base77[32]     = {0x85,0x6a,0xab,0x1d,0x29,0x6c,0xb0,0x8c,0x48,0x86,0x05,0x8b,0x59,0x12,0xeb,0x60,0x25,0x58,0xd6,0xc0,0x2b,0xf3,0x97,0x75,0x81,0x24,0x7d,0xd4,0xbc,0xbc,0x58,0xa3};
    std::uint8_t exponent77[32] = {0x63,0x4d,0x19,0x52,0xa2,0xe8,0xfe,0xc0,0xed,0x19,0x55,0x7a,0x9b,0x8e,0x9a,0x82,0x0d,0xa9,0xf4,0x4a,0x50,0x84,0xc6,0x3f,0x7b,0x94,0x9e,0x54,0xe9,0xad,0x2b,0xc7};
    std::uint8_t power77[32]    = {0x58,0x47,0xf7,0x5b,0x5e,0x01,0x98,0x23,0xd4,0x43,0x72,0x4d,0x4f,0x72,0xfa,0xc1,0x88,0x1a,0x00,0x62,0xd7,0x2e,0x63,0xb6,0x08,0x71,0xe2,0x70,0x03,0xf9,0x0b,0x8e};
    mont256_from_bytes(&ctx, base, base77);
    uint256_from_bytes(exponent, exponent77);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power77, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base78[32]     = {0xa3,0xec,0x4d,0x32,0x29,0x07,0xdb,0x86,0xe4,0x21,0x93,0x07,0xd3,0x16,0x15,0xe5,0xb0,0x2e,0xf5,0xf7,0x9e,0xce,0xcb,0xff,0xb6,0x59,0xf7,0x68,0xe7,0x7b,0x04,0x75};
    std::uint8_t exponent78[32] = {0x84,0x94,0x9a,0xab,0xf0,0x44,0xc0,0x32,0x66,0x55,0xb9,0xf0,0x0a,0xad,0xac,0xf0,0x37,0xd7,0xd1,0x90,0x90,0xbf,0xd7,0x92,0x2e,0xd6,0xd4,0x60,0x79,0x13,0x97,0xa3};
    std::uint8_t power78[32]    = {0x8b,0xf8,0xdf,0x43,0x76,0x33,0x3c,0xb6,0xae,0x6d,0x8e,0x1f,0x08,0x8e,0xf2,0xf1,0x12,0x22,0x82,0xda,0x4d,0x9c,0x93,0x25,0x5a,0x01,0xbd,0x07,0x34,0x0f,0x61,0xdf};
    mont256_from_bytes(&ctx, base, base78);
    uint256_from_bytes(exponent, exponent78);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power78, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base79[32]     = {0xd0,0xce,0x6b,0xc4,0xb9,0x91,0xe9,0x61,0xf8,0x7f,0x4a,0x4d,0x3f,0x3f,0x40,0x72,0x26,0x43,0x7a,0x8e,0x1f,0x80,0xa4,0xe8,0x5b,0xf5,0x08,0xa0,0x62,0x32,0x0f,0xa3};
    std::uint8_t exponent79[32] = {0xac,0x18,0xcd,0x4e,0xc1,0xe8,0xfb,0x16,0xd7,0xad,0x18,0xa7,0x8f,0xf5,0xba,0x77,0xe2,0x44,0xd0,0x5f,0x0a,0x85,0x77,0x46,0x31,0x4d,0xf3,0x86,0xe5,0xb5,0x20,0x6e};
    std::uint8_t power79[32]    = {0x66,0xbc,0x55,0x66,0x4d,0xcb,0xb7,0x96,0xb5,0x05,0x8b,0x53,0x38,0x60,0xe1,0xb0,0x6a,0xb4,0x05,0xa4,0xcf,0x94,0x33,0x72,0x25,0x59,0x10,0x79,0x1f,0x3d,0x60,0x2c};
    mont256_from_bytes(&ctx, base, base79);
    uint256_from_bytes(exponent, exponent79);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power79, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base80[32]     = {0x8c,0xd0,0x32,0x60,0x74,0xaa,0xf3,0x40,0x99,0x7a,0x20,0xbe,0x63,0xcc,0x53,0x7b,0x1e,0x23,0x9e,0xb4,0x52,0xfe,0xf4,0x78,0xd6,0x94,0x8d,0xed,0xaa,0xfb,0x42,0x94};
    std::uint8_t exponent80[32] = {0x95,0x26,0xe3,0xd0,0x4e,0xe6,0xf4,0xff,0x6b,0x89,0xd4,0x63,0xa6,0x26,0xb0,0x97,0x4e,0x64,0x0c,0xd4,0xc7,0x30,0xa7,0xcb,0xa0,0x85,0xda,0x1f,0xd9,0x58,0xb1,0xe6};
    std::uint8_t power80[32]    = {0x34,0xce,0xe1,0xe3,0xf5,0x20,0xb5,0x3a,0x5c,0xbf,0x78,0x9f,0x1d,0xab,0x95,0xac,0x93,0xe4,0xee,0xb9,0x03,0x97,0x9c,0xd2,0x88,0xf9,0x0d,0x8a,0x62,0x53,0x4a,0x81};
    mont256_from_bytes(&ctx, base, base80);
    uint256_from_bytes(exponent, exponent80);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power80, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base81[32]     = {0x2d,0xc3,0x78,0xf2,0x70,0x37,0xe0,0x34,0x80,0xea,0x83,0x97,0x72,0x60,0xca,0x26,0x5e,0x11,0x34,0x23,0xa8,0xa9,0xea,0x62,0x63,0xa3,0x66,0xaa,0x6c,0xfd,0x49,0x40};
    std::uint8_t exponent81[32] = {0x79,0x24,0xde,0xde,0xcf,0x7e,0xda,0x11,0x2d,0xf8,0x3c,0x66,0xd6,0x27,0xd2,0xb8,0x75,0x52,0x6e,0x31,0xd1,0xa8,0x08,0x88,0xc7,0xac,0x6f,0x37,0x9e,0x5a,0xf2,0xa4};
    std::uint8_t power81[32]    = {0xc6,0xd0,0x3c,0xb7,0xf0,0xe3,0xb4,0x69,0x99,0x34,0x84,0x98,0x4f,0x73,0x9e,0x37,0xf3,0xa5,0xf6,0x9c,0xfd,0x37,0xa9,0x6d,0xf9,0x40,0xee,0x62,0x29,0xc1,0xaf,0xf4};
    mont256_from_bytes(&ctx, base, base81);
    uint256_from_bytes(exponent, exponent81);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power81, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base82[32]     = {0xcd,0x62,0x5a,0x7f,0x17,0x7a,0x83,0x34,0x5d,0x86,0x6b,0x34,0x6e,0x3b,0xbc,0x97,0x5b,0xcb,0x93,0x70,0x20,0xe2,0x7c,0x17,0x11,0x2e,0xd1,0xdf,0x1b,0x69,0x56,0x7e};
    std::uint8_t exponent82[32] = {0x21,0x59,0x70,0x2b,0xa2,0xed,0x89,0x62,0x0a,0x68,0x25,0x3a,0x0a,0x6f,0xb1,0x54,0xa8,0x37,0x6d,0xcd,0x82,0x99,0xed,0x6e,0x81,0x1c,0x8f,0xa7,0x71,0x24,0xc2,0x05};
    std::uint8_t power82[32]    = {0xac,0x84,0xb7,0xf9,0x63,0x21,0x9c,0x2d,0x2c,0x44,0x1f,0x3d,0x4d,0xb8,0x01,0x44,0x7c,0x5a,0xec,0x21,0x0c,0x0d,0x78,0xab,0xc0,0xe5,0x42,0xb8,0x62,0x78,0x31,0x54};
    mont256_from_bytes(&ctx, base, base82);
    uint256_from_bytes(exponent, exponent82);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power82, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base83[32]     = {0x0d,0xe4,0x4e,0x65,0x14,0x78,0xc7,0xb9,0x82,0xf0,0x77,0x9d,0xb8,0x6b,0xb4,0xd6,0xc7,0x13,0x28,0x91,0x50,0x50,0x56,0x52,0xbb,0xc5,0x5c,0x33,0xec,0x10,0x72,0xee};
    std::uint8_t exponent83[32] = {0x22,0xdd,0x11,0x3c,0xc8,0xc4,0x22,0x76,0xf3,0x6c,0x15,0x75,0xa7,0x1a,0x56,0xc6,0x60,0xbb,0x9a,0xee,0xe5,0x16,0x09,0x31,0x81,0x01,0x2a,0xd6,0xc0,0x86,0xee,0x53};
    std::uint8_t power83[32]    = {0x10,0xa8,0x8e,0x3a,0x5b,0x4f,0x4c,0xa3,0x27,0xee,0x70,0xdc,0x7a,0x9b,0x0e,0x84,0x82,0x41,0xe1,0x37,0x89,0x09,0x93,0x75,0x19,0x4f,0x8b,0x13,0x6e,0xc5,0x36,0x52};
    mont256_from_bytes(&ctx, base, base83);
    uint256_from_bytes(exponent, exponent83);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power83, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base84[32]     = {0x1c,0x0d,0xf6,0x45,0xd0,0xa3,0x26,0x11,0xb1,0x4a,0xed,0x54,0xbb,0x69,0xe1,0xf0,0x9d,0x37,0x37,0x31,0xff,0x01,0xfe,0x80,0x10,0xfe,0x52,0xd4,0xdb,0x68,0xf2,0x75};
    std::uint8_t exponent84[32] = {0x9d,0x10,0x6a,0x37,0xe5,0x83,0x76,0xfb,0x52,0xe7,0x1c,0xf8,0x28,0xa4,0xfb,0xd7,0x40,0x91,0x8a,0x58,0xc1,0x94,0xff,0x53,0x9c,0x46,0x19,0x92,0x59,0xd4,0x69,0x7f};
    std::uint8_t power84[32]    = {0x83,0x93,0xf7,0x11,0xa6,0xad,0xe9,0x61,0xa3,0xf4,0x70,0xcc,0x19,0x5b,0x26,0x94,0x5b,0x6f,0x4d,0x36,0xfd,0x50,0xb4,0x53,0xeb,0x41,0xef,0xcd,0x87,0x5a,0xd6,0xae};
    mont256_from_bytes(&ctx, base, base84);
    uint256_from_bytes(exponent, exponent84);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power84, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base85[32]     = {0xeb,0x7f,0x14,0x14,0xf6,0xde,0x2f,0xbe,0x80,0x91,0x5a,0xaf,0x41,0x10,0xb8,0xbc,0x24,0xc1,0x27,0x6c,0x74,0xd6,0xd1,0x1f,0xd0,0xcc,0xe8,0x93,0xe7,0xb2,0x27,0xe9};
    std::uint8_t exponent85[32] = {0x51,0xaf,0x10,0x74,0x3c,0xc6,0x31,0x41,0x81,0x89,0xac,0x45,0x9d,0xa9,0x68,0xf2,0x43,0x4b,0x4b,0x94,0x97,0x85,0xf4,0xf8,0x35,0x54,0xad,0xa8,0x7a,0xe8,0x54,0x84};
    std::uint8_t power85[32]    = {0xb3,0x0b,0x1f,0x5c,0x6f,0xd3,0xb7,0xe6,0xe4,0x77,0xfd,0x39,0xda,0x53,0x33,0x0f,0xde,0x53,0xf0,0x86,0xc3,0x91,0xfc,0x4a,0xf0,0x60,0xd8,0x50,0x85,0xe7,0x23,0x58};
    mont256_from_bytes(&ctx, base, base85);
    uint256_from_bytes(exponent, exponent85);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power85, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base86[32]     = {0x47,0x37,0xfe,0xd1,0xef,0xb8,0x28,0x25,0xa2,0xf6,0x5e,0x36,0x29,0x46,0x53,0x88,0x67,0x49,0x83,0x14,0x2e,0x9d,0xde,0x73,0x32,0xed,0xdf,0x6f,0x09,0x6d,0xe4,0x21};
    std::uint8_t exponent86[32] = {0x43,0xab,0xd7,0xad,0xc8,0xed,0x32,0x13,0xca,0xc8,0xa6,0x1c,0x2b,0x32,0xad,0xa9,0x60,0x78,0xa4,0x06,0xe5,0x39,0xcb,0x16,0x53,0xec,0x4b,0x93,0xad,0xff,0x81,0x65};
    std::uint8_t power86[32]    = {0x8d,0x4a,0x4a,0xc3,0xfd,0x9c,0x78,0x08,0x80,0xf6,0xfa,0x88,0x94,0x7f,0xc6,0x20,0xc5,0xdc,0xbe,0xd5,0x41,0xe0,0x26,0x53,0xea,0x7f,0xde,0x60,0xe6,0x33,0x71,0x9f};
    mont256_from_bytes(&ctx, base, base86);
    uint256_from_bytes(exponent, exponent86);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power86, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base87[32]     = {0xdf,0x79,0xc9,0xee,0xf7,0x55,0xed,0xba,0x5c,0x1a,0x7c,0x01,0xdb,0xb8,0xd3,0x6b,0xa2,0xe5,0xc7,0xd7,0x0c,0x6f,0x2f,0xcc,0x87,0xdd,0x58,0xd9,0xc4,0xad,0x10,0x06};
    std::uint8_t exponent87[32] = {0x1a,0xc7,0xa4,0x6c,0xe5,0x66,0xe1,0x33,0xe1,0xed,0xcf,0x3e,0xb0,0x50,0x86,0x4e,0x94,0x7d,0xbe,0x2d,0x85,0x7d,0xe9,0x6d,0x8e,0x20,0x48,0xdc,0x73,0xfa,0x56,0x48};
    std::uint8_t power87[32]    = {0x0f,0xb8,0xac,0xfe,0x35,0xd8,0xee,0xab,0x9f,0xe0,0x8d,0x4a,0x16,0x2d,0xaf,0x35,0xcd,0x3f,0x90,0x50,0x6d,0x8e,0x6c,0x71,0x97,0x9f,0x19,0x1b,0x15,0x37,0xe3,0x86};
    mont256_from_bytes(&ctx, base, base87);
    uint256_from_bytes(exponent, exponent87);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power87, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base88[32]     = {0x5f,0x18,0x69,0x04,0xcc,0x34,0x24,0x16,0xbc,0xe8,0x87,0x96,0x64,0xed,0xfc,0xe5,0xdb,0x4a,0x18,0xfc,0xa1,0x39,0x03,0x85,0x89,0x23,0xb7,0xf6,0xfe,0x32,0x45,0xfe};
    std::uint8_t exponent88[32] = {0x0c,0x5c,0xd4,0x3b,0xf5,0x3e,0x2c,0x38,0xbe,0x5c,0x39,0x31,0x9d,0x89,0x20,0x98,0x2d,0x3f,0xe2,0x97,0x3a,0xe4,0x61,0x55,0x71,0x39,0x5e,0x71,0x14,0xd5,0xae,0xa4};
    std::uint8_t power88[32]    = {0x32,0x01,0xdf,0xdc,0xae,0xc4,0xfd,0x91,0x7e,0xaf,0x02,0x0c,0x89,0xcf,0x55,0x14,0x30,0xe0,0x32,0x7f,0xca,0xac,0x2d,0xdd,0x35,0x79,0x2a,0x92,0x3a,0x38,0x0a,0x8b};
    mont256_from_bytes(&ctx, base, base88);
    uint256_from_bytes(exponent, exponent88);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power88, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base89[32]     = {0xde,0xcb,0xc1,0x0b,0xfb,0xeb,0x0a,0x98,0xf7,0x48,0xf9,0x31,0xa3,0xa5,0x17,0x59,0x4f,0x60,0xe8,0x46,0x40,0xef,0x5e,0xc2,0x84,0x1f,0x92,0xca,0xd1,0xe0,0x01,0x4e};
    std::uint8_t exponent89[32] = {0xbf,0x43,0x3e,0x03,0x00,0x75,0x5f,0x64,0xbb,0xa8,0x6d,0xf7,0x50,0x09,0xc0,0xa9,0xe5,0x4e,0x19,0xe5,0xa9,0xe8,0x25,0x81,0xed,0xaf,0x80,0xf3,0x95,0xfb,0x98,0xf9};
    std::uint8_t power89[32]    = {0x97,0xd1,0x03,0x16,0x64,0xe8,0x0f,0x8b,0x32,0xe8,0xaf,0x63,0x6e,0xaf,0x6d,0x55,0x22,0x5d,0xc4,0x9e,0xb6,0x19,0xd6,0x35,0xbc,0x48,0x45,0xc8,0x11,0x3f,0x3d,0x12};
    mont256_from_bytes(&ctx, base, base89);
    uint256_from_bytes(exponent, exponent89);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power89, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base90[32]     = {0x83,0x3e,0xdd,0x4b,0x6a,0xed,0x88,0x72,0x6e,0xa6,0xd0,0x5e,0xa0,0x28,0x80,0x56,0x9d,0xb5,0x96,0x58,0x4a,0x7d,0x1d,0xbc,0x26,0x3c,0xc4,0xdc,0x38,0xbd,0x3c,0x69};
    std::uint8_t exponent90[32] = {0xa7,0x32,0x1d,0x31,0x9c,0xce,0x12,0xd5,0x3a,0x2d,0xb0,0x0a,0x7d,0x07,0x6c,0x0b,0x21,0xcc,0x47,0x51,0x0c,0x3b,0x12,0x66,0xe5,0x42,0x45,0x3d,0x5d,0x35,0x97,0x77};
    std::uint8_t power90[32]    = {0xb7,0xb1,0xae,0x13,0xac,0x9d,0xdf,0x0c,0xfa,0x32,0x5f,0x1c,0x5a,0x88,0xf8,0xe2,0x64,0x22,0xdf,0x00,0x8a,0xbe,0x7e,0x28,0x19,0xc2,0x4f,0x03,0x8f,0xde,0xd4,0x8a};
    mont256_from_bytes(&ctx, base, base90);
    uint256_from_bytes(exponent, exponent90);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power90, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base91[32]     = {0x85,0xe9,0x25,0x1c,0x1b,0x3a,0x95,0x3c,0x4d,0xc1,0xd3,0x27,0x5a,0xde,0xd3,0xca,0x91,0x2e,0xda,0x41,0x00,0xab,0x68,0xb8,0x0d,0xec,0xb3,0xb5,0x05,0xb4,0xc4,0x25};
    std::uint8_t exponent91[32] = {0x22,0x3b,0xe9,0xe7,0x96,0xce,0xb5,0x25,0x4d,0x18,0x7e,0x3e,0x95,0x66,0x36,0xe6,0x69,0xc9,0xfe,0xf0,0x39,0x69,0x09,0x19,0x88,0xbb,0xa3,0x17,0x5b,0x6e,0x48,0xb0};
    std::uint8_t power91[32]    = {0x42,0x01,0xf0,0x86,0x7c,0xe6,0x2e,0x53,0x0f,0xa8,0xac,0x38,0x9f,0xc1,0x7a,0x36,0xc5,0xbe,0xa9,0x53,0xe3,0x43,0x50,0x5a,0xed,0x6e,0x85,0xc8,0xe8,0xb1,0x55,0xc9};
    mont256_from_bytes(&ctx, base, base91);
    uint256_from_bytes(exponent, exponent91);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power91, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base92[32]     = {0xef,0xc4,0x6c,0x08,0x03,0x9c,0xd8,0x62,0x22,0x7e,0xe4,0x09,0x28,0x9b,0x8b,0xa9,0x79,0x93,0x2a,0x50,0xd4,0x16,0xb8,0xa9,0x9f,0xb9,0xd8,0xf6,0x5d,0xc1,0x8b,0xce};
    std::uint8_t exponent92[32] = {0xa3,0x61,0xbc,0xa2,0x10,0x4c,0x96,0x8a,0x18,0x86,0xa7,0xba,0x73,0x6b,0x1b,0xe2,0x26,0x39,0x61,0xd1,0xb5,0x1c,0xec,0xef,0x3e,0x5b,0xcc,0xe6,0xcd,0x2f,0x49,0x34};
    std::uint8_t power92[32]    = {0xbf,0xf2,0x50,0x1d,0x23,0x1d,0x78,0x11,0x19,0x6a,0x10,0xfe,0x7e,0x01,0x0d,0xe4,0x2d,0x70,0x21,0x29,0x2a,0xdc,0x45,0x1b,0x35,0x18,0xb6,0xd4,0x39,0x7b,0x57,0xdc};
    mont256_from_bytes(&ctx, base, base92);
    uint256_from_bytes(exponent, exponent92);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power92, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base93[32]     = {0xf7,0x96,0x2f,0x83,0x43,0xa5,0x38,0xc4,0xcf,0xc3,0x16,0x01,0x66,0xe6,0x62,0x6d,0x45,0x0f,0x00,0x2a,0xc8,0x3b,0x62,0x69,0xaa,0x5c,0x68,0x17,0xdf,0x0c,0x92,0xb9};
    std::uint8_t exponent93[32] = {0x3f,0x9d,0x80,0x24,0x7e,0x2b,0x86,0xd1,0xbb,0xc8,0x1f,0x54,0x84,0x80,0x49,0x42,0xef,0xe9,0x87,0x72,0x9a,0x14,0xe7,0x5a,0x71,0x99,0xe0,0xb3,0x94,0x16,0xc6,0x10};
    std::uint8_t power93[32]    = {0x33,0x5b,0x45,0x5a,0x60,0x8f,0xf4,0x3c,0x48,0xde,0xa1,0x66,0xbe,0xb2,0x96,0x57,0xe5,0x09,0x65,0x70,0x84,0x5d,0xf4,0x6a,0xe1,0x3b,0xbb,0x57,0x70,0xec,0xe8,0x3f};
    mont256_from_bytes(&ctx, base, base93);
    uint256_from_bytes(exponent, exponent93);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power93, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base94[32]     = {0x2f,0x87,0x46,0x6e,0x67,0xee,0xe0,0x99,0x06,0x75,0x29,0x5f,0x88,0x12,0x2e,0x14,0x0f,0xc0,0x55,0x31,0x0b,0x43,0xb6,0xdd,0x00,0x1a,0x2f,0xd3,0xe7,0x4c,0x00,0xf4};
    std::uint8_t exponent94[32] = {0x82,0x32,0x09,0xb5,0x2c,0xb5,0x2c,0x32,0x9c,0xf9,0x9a,0x99,0xd0,0x39,0xb9,0x63,0x6a,0x4d,0x76,0xe6,0xa4,0x3d,0xed,0xe7,0xa5,0xc8,0xe5,0xc5,0x81,0xc7,0x5b,0xab};
    std::uint8_t power94[32]    = {0x6b,0x6b,0xab,0xbc,0xc9,0x38,0xcf,0x7b,0x93,0x8a,0x49,0x08,0x76,0x1e,0xe7,0xf6,0xb2,0xff,0x8f,0x27,0xe3,0x0a,0x8b,0x5e,0xe5,0xff,0x8c,0x9c,0x89,0xa5,0x7f,0xe5};
    mont256_from_bytes(&ctx, base, base94);
    uint256_from_bytes(exponent, exponent94);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power94, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base95[32]     = {0xc8,0x70,0xfe,0xf2,0xb9,0x6c,0x1f,0x73,0xe3,0xac,0x99,0xb2,0xfe,0x7a,0xcd,0xe2,0x0c,0x69,0xe4,0x24,0xa0,0x3f,0x2a,0x2b,0x4c,0xde,0x3e,0x5a,0x10,0x53,0x0b,0xe2};
    std::uint8_t exponent95[32] = {0xff,0x21,0xdd,0x5a,0x39,0xd7,0xc1,0x40,0x2c,0xe6,0x78,0xfe,0x73,0xd6,0x34,0x26,0xa7,0xd0,0xe5,0x97,0xbd,0xe3,0xa6,0xe4,0x14,0x9a,0x3e,0x17,0x77,0x1b,0xa4,0xba};
    std::uint8_t power95[32]    = {0xd2,0x3b,0xce,0xb7,0x2f,0xe7,0xb6,0x5a,0x50,0x3d,0x13,0xeb,0xc8,0xee,0xdd,0xd2,0x3c,0xc1,0x7f,0x1e,0xe6,0xd4,0x7d,0x69,0xef,0x17,0x1e,0x4a,0xc3,0xfb,0xb6,0x49};
    mont256_from_bytes(&ctx, base, base95);
    uint256_from_bytes(exponent, exponent95);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power95, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base96[32]     = {0xbf,0xe9,0x54,0x13,0xe4,0x2a,0x87,0x2f,0x55,0xe4,0x61,0x5b,0x1f,0x8e,0x65,0x21,0x09,0xef,0xf2,0xb4,0xa4,0xde,0x7a,0x8d,0x3b,0x77,0xcb,0xb4,0x42,0xec,0xdc,0xf9};
    std::uint8_t exponent96[32] = {0xf8,0xcd,0xe5,0x9b,0x85,0xf3,0x5c,0x2e,0xea,0xd2,0x8c,0x16,0xc9,0xd7,0xdc,0x2a,0xaf,0x8c,0x3e,0x74,0x6f,0xa1,0x26,0xa8,0xad,0xe2,0x56,0x55,0x8d,0xc5,0x08,0xc6};
    std::uint8_t power96[32]    = {0x65,0x99,0x3a,0xb0,0x6b,0x07,0xa5,0xfc,0xcc,0x5b,0x4c,0xdc,0x3a,0x3e,0x9c,0xee,0x39,0xa8,0xa0,0x7a,0x3e,0x10,0xff,0xf6,0x24,0x3d,0x97,0xae,0xd6,0xe7,0xf8,0xb7};
    mont256_from_bytes(&ctx, base, base96);
    uint256_from_bytes(exponent, exponent96);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power96, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base97[32]     = {0xe1,0x4a,0xa4,0x60,0x15,0xde,0x28,0x68,0x37,0x8d,0x04,0xea,0xe4,0xe8,0xd8,0xd2,0xf7,0x13,0x77,0xdc,0xed,0xb6,0xce,0x85,0xa4,0x5a,0x52,0x09,0x4b,0xad,0x8e,0x0e};
    std::uint8_t exponent97[32] = {0xbe,0x6e,0xd5,0x15,0xd7,0x7b,0x26,0xd3,0x3c,0x71,0xa8,0x96,0xe7,0x9a,0x95,0xaa,0x42,0xa7,0x85,0x00,0x2b,0x76,0x04,0xfe,0x03,0xe5,0xf6,0x84,0x81,0xe6,0xd6,0xc8};
    std::uint8_t power97[32]    = {0x4d,0xda,0xac,0x7b,0x5a,0xc1,0x20,0x35,0xf3,0xed,0x64,0x4c,0xcc,0xb8,0x16,0x70,0x9c,0x79,0x2a,0xc6,0x4d,0x42,0xcd,0xc8,0x97,0x20,0x97,0xaa,0x90,0x96,0x84,0x4e};
    mont256_from_bytes(&ctx, base, base97);
    uint256_from_bytes(exponent, exponent97);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power97, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base98[32]     = {0x63,0x82,0x50,0x46,0xe1,0x52,0x7a,0xe4,0x31,0x22,0xc8,0x15,0x53,0xad,0xd8,0x17,0xea,0x3a,0xb6,0xd2,0xbf,0x03,0xc6,0x44,0x28,0xc0,0x6f,0x25,0xf1,0xd7,0xb8,0xaa};
    std::uint8_t exponent98[32] = {0x0a,0xa9,0x89,0xb4,0x07,0xe7,0x16,0x6b,0x07,0x5b,0x05,0x8b,0xb3,0x63,0xaf,0x43,0x24,0x4f,0xba,0xfc,0xfa,0x37,0x6a,0x6e,0x58,0x48,0xfc,0x64,0x29,0x6c,0x76,0x4d};
    std::uint8_t power98[32]    = {0xd3,0x5b,0x76,0x87,0x67,0xf0,0x12,0x9f,0x86,0xb9,0x1b,0x8a,0xe4,0x33,0xd7,0xde,0x29,0x60,0xa7,0xdc,0x8d,0xd2,0x0b,0xa8,0xf2,0x48,0xc5,0x5e,0x95,0xb1,0xd5,0xd3};
    mont256_from_bytes(&ctx, base, base98);
    uint256_from_bytes(exponent, exponent98);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power98, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
    std::uint8_t base99[32]     = {0x0b,0xf3,0xd0,0xa7,0xbc,0x9d,0xf5,0x99,0x11,0x5d,0x27,0xcf,0xb2,0x6f,0x19,0x28,0x0a,0xea,0xde,0x9b,0xa2,0x45,0xd6,0x58,0xa4,0xbf,0x58,0xe7,0xb1,0x4f,0xe2,0xd6};
    std::uint8_t exponent99[32] = {0x08,0xab,0x17,0x15,0x1c,0xaa,0x0c,0x48,0x34,0x02,0x52,0xa6,0x34,0xaa,0x4a,0x20,0x3f,0x1f,0xb2,0x41,0x1b,0x6b,0xf2,0x73,0x62,0x43,0x83,0x62,0xf1,0xbf,0x55,0xed};
    std::uint8_t power99[32]    = {0x50,0x24,0xcb,0x5b,0x59,0x9d,0xbd,0xdc,0xfc,0xaf,0x11,0xf3,0xa6,0xd9,0x97,0xa3,0x4b,0xb4,0x15,0xb2,0x3b,0xfd,0xd1,0x86,0x45,0xf5,0xea,0xb5,0x5c,0x39,0xe6,0xde};
    mont256_from_bytes(&ctx, base, base99);
    uint256_from_bytes(exponent, exponent99);
    mont256_pow(&ctx, power, base, exponent);
    mont256_to_bytes(&ctx, power_data, power);
    if (std::memcmp(power99, power_data, 32) != 0)
    {
        throw std::runtime_error("err in mont256_pow");
    }
}
